Compare commits

...

38 commits

Author SHA1 Message Date
Johannes Marbach f1bac3805a
Merge e3ca1ba2b8 into 48051c3450 2026-04-23 09:47:06 +01:00
Andy Balaam 48051c3450
Specify m.key_backup account data (MSC4287) (#2354)
Some checks failed
Spec / 🔎 Validate OpenAPI specifications (push) Has been cancelled
Spec / 🔎 Check Event schema examples (push) Has been cancelled
Spec / 🔎 Check OpenAPI definitions examples (push) Has been cancelled
Spec / 🔎 Check JSON Schemas inline examples (push) Has been cancelled
Spec / ⚙️ Calculate baseURL for later jobs (push) Has been cancelled
Spec / 📢 Run towncrier for changelog (push) Has been cancelled
Spell Check / Spell Check with Typos (push) Has been cancelled
Spec / 🐍 Build OpenAPI definitions (push) Has been cancelled
Spec / 📖 Build the spec (push) Has been cancelled
Spec / 🔎 Validate generated HTML (push) Has been cancelled
Spec / 📖 Build the historical backup spec (push) Has been cancelled
Spec / Create release (push) Has been cancelled
Signed-off-by: Andy Balaam <andy.balaam@matrix.org>
Co-authored-by: Tulir Asokan <tulir@maunium.net>
Co-authored-by: Kévin Commaille <76261501+zecakeh@users.noreply.github.com>
2026-04-22 10:27:55 +01:00
Tulir Asokan c68e687a8c
Define where to find via for following tombstone/predecessor (#2352)
Some checks are pending
Spec / 🔎 Validate OpenAPI specifications (push) Waiting to run
Spec / 🔎 Check Event schema examples (push) Waiting to run
Spec / 🔎 Check OpenAPI definitions examples (push) Waiting to run
Spec / 🔎 Check JSON Schemas inline examples (push) Waiting to run
Spec / ⚙️ Calculate baseURL for later jobs (push) Waiting to run
Spec / 🐍 Build OpenAPI definitions (push) Blocked by required conditions
Spec / 📢 Run towncrier for changelog (push) Waiting to run
Spec / 📖 Build the spec (push) Blocked by required conditions
Spec / 🔎 Validate generated HTML (push) Blocked by required conditions
Spec / 📖 Build the historical backup spec (push) Blocked by required conditions
Spec / Create release (push) Blocked by required conditions
Spell Check / Spell Check with Typos (push) Waiting to run
Signed-off-by: Tulir Asokan <tulir@maunium.net>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2026-04-21 22:20:15 +00:00
Kévin Commaille 0cff46c7d4
Upgrade docsy to v0.14.3 (#2346)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2026-04-21 22:43:08 +01:00
timedout 09e745bcdf
Specify replaces_state in ClientEvent (#2345)
Signed-off-by: timedout <git@nexy7574.co.uk>
2026-04-21 21:53:17 +01:00
Johannes Marbach e3ca1ba2b8 Load main results in pages of 3
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-03-24 15:48:57 +01:00
Johannes Marbach 4f0eba6355 Fix broken close button
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-03-24 15:17:22 +01:00
Johannes Marbach 8fb380d465 Load and render main results one by one
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-03-24 15:11:52 +01:00
Johannes Marbach 754e9c82b8 Document why we cannot use wasm-unsafe-eval yet
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-03-24 11:34:59 +01:00
Johannes Marbach 86675ad4a4 Only start searching upon hitting Enter
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-03-24 11:32:27 +01:00
Johannes Marbach 49fec082f5 Use empty and append to insert the html
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-03-24 11:24:13 +01:00
Johannes Marbach 0cc8ee38d5 Use btn-link style for expander
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-03-24 11:22:21 +01:00
Johannes Marbach af1e9382ca Use a <button> for the closer
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-03-24 11:16:37 +01:00
Johannes Marbach 84b5e98f25 Switch to (outline) buttons for the expander
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-03-24 11:07:57 +01:00
Johannes Marbach 0cf8fca4da Unwrap jQuery object
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-03-24 10:59:39 +01:00
Johannes Marbach bccbff878d Fix relative path to pagefind script
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-03-24 10:56:03 +01:00
Johannes Marbach 308bcfd20e Pin pagefind version
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-03-24 10:41:01 +01:00
Johannes Marbach 1f5d598754
Fix typo in HTML ID
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-24 10:23:11 +01:00
Johannes Marbach 59c7282ddb
Use correct pluralisation for zero results
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-24 10:22:03 +01:00
Johannes Marbach f49668d722
Fix typo
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-24 10:20:31 +01:00
Johannes Marbach 1c2e58d66f
Use relative path for pagefind JS
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-24 10:17:37 +01:00
Johannes Marbach de25ba5265 Document how to build the search index locally
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-03-20 14:14:45 +01:00
Johannes Marbach e9a29f27dc Fix CSP
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-03-20 14:05:19 +01:00
Andrew Morgan 2fd3c28a7a Attempt to fix page jump upon expanding search results 2026-03-20 12:54:14 +00:00
Johannes Marbach 15f36d1934 Only use plural of 'results' when actually necessary
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-03-20 13:44:11 +01:00
Johannes Marbach 9edb9b3e5b Add triangle indicator on expander buttons and remove left margins
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-03-20 13:38:12 +01:00
Johannes Marbach 94fca47a7d Add total number of subresults per main result
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-03-20 13:37:41 +01:00
Johannes Marbach a56969149f Stop bluring the input
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-03-20 13:18:36 +01:00
Johannes Marbach 72205be3dc Set cursor style and a11y label on close button
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-03-20 13:13:05 +01:00
Johannes Marbach 8e383835b9 Toggle expander label between show and hide
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-03-20 13:08:53 +01:00
Johannes Marbach 92b7e714e7 Add loading spinner while the search is running
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-03-20 12:52:01 +01:00
Johannes Marbach 6f05c2c78e Improve search field placeholder
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-03-19 15:13:29 +01:00
Johannes Marbach 9a1b7ffa7c Group subresults
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-03-19 08:50:45 +01:00
Johannes Marbach e679a00720 Override search-input template
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-03-17 14:16:24 +01:00
Johannes Marbach 7dfd746e06 Remove leftovers
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-03-17 13:21:42 +01:00
Johannes Marbach 77f7e8104a Merge branch 'main' into johannes/page-search 2026-03-17 13:09:06 +01:00
Johannes Marbach b3d4f9a96e Change to using Pagefind via the built-in Docsy search UI
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-03-17 13:04:43 +01:00
Johannes Marbach fdd2a9abe8 Add page search widget
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2026-03-06 15:25:50 +01:00
23 changed files with 613 additions and 17 deletions

View file

@ -1,7 +1,7 @@
name: "Spec"
env:
HUGO_VERSION: 0.153.3
HUGO_VERSION: 0.155.3
PYTHON_VERSION: 3.13
NODE_VERSION: 24
@ -236,6 +236,10 @@ jobs:
run: |
tar -C "spec${baseURL}" --strip-components=1 -xzf openapi.tar.gz
- name: "🔍 pagefind indexing"
run: |
npm run pagefind -- --site "spec${baseURL}"
- name: "📦 Tarball creation"
run: |
cd spec

View file

@ -61,7 +61,7 @@ place after an MSC has been accepted, not as part of a proposal itself.
1. Install the extended version (often the OS default) of Hugo:
<https://gohugo.io/getting-started/installing>. Note that at least Hugo
v0.146.0 is required.
v0.155.0 is required.
Alternatively, use the Docker image at
https://hub.docker.com/r/klakegg/hugo/. (The "extended edition" is required
@ -79,6 +79,18 @@ We use a highly customized [Docsy](https://www.docsy.dev/) theme for our generat
Awesome. If you're looking at making design-related changes to the spec site, please coordinate with us in
[#matrix-docs:matrix.org](https://matrix.to/#/#matrix-docs:matrix.org) before opening a PR.
## Page search
The spec uses [Pagefind](https://pagefind.app/) to provide a page search widget. To test this locally, you'll need to generate the
search index _after_ building the static site.
```
hugo build && npm run pagefind -- --site public && hugo serve
```
Note that while `hugo serve` supports hot reloading, changes made to the site content won't reflect in the search index without
rebuilding it.
## Building the specification
If for some reason you're not a CI/CD system and want to render a static version of the spec for yourself, follow the above

290
assets/js/offline-search.js Normal file
View file

@ -0,0 +1,290 @@
/*
Copyright 2026 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
Adapted from [1] to combine Docsy's built-in search UI with the Pagefind
search backend.
[1]: https://github.com/matrix-org/docsy/blob/71d103ebb20ace3d528178c4b6d92b6cc4f7fd53/assets/js/offline-search.js
*/
(function ($) {
"use strict";
$(document).ready(async function () {
// This is going to be loaded from ${deployment}/js/main.js so to use a relative path
// to the Pagefind script we need to navigate one level up.
const pagefind = await import("../pagefind/pagefind.js");
const $searchInput = $(".td-search input");
//
// Lazily initialise Pagefind only when the user is about to start a search.
//
$searchInput.focus(() => {
pagefind.init();
});
//
// Set up search input handler.
//
$searchInput.on("keypress", (event) => {
// Start searching only upon Enter.
if (event.which === 13) {
event.preventDefault();
render($(event.target));
return;
}
});
// Prevent reloading page by enter key on sidebar search.
$searchInput.closest("form").on("submit", () => {
return false;
});
//
// Callback for searching and rendering the results.
//
const render = async ($targetSearchInput) => {
//
// Dispose any existing popover.
//
disposePopover($targetSearchInput);
//
// Check if we need to do a search at all.
//
const searchQuery = $targetSearchInput.val();
if (searchQuery === "") {
return;
}
//
// Prepare the results popover.
//
const $html = $("<div>");
// Add the header and close button.
$html.append($("<div>")
.css({
display: "flex",
justifyContent: "space-between",
marginBottom: "1em",
})
.append($("<span>")
.text("Search results")
.css({ fontWeight: "bold" }))
.append($("<button>")
.addClass("td-offline-search-results__close-button")
.addClass("btn")
.addClass("btn-sm")
.addClass("btn-link")
.attr("type", "button")
.attr("aria-label", "Close")
.on("click", () => {
$targetSearchInput.val("");
disposePopover($targetSearchInput);
})
)
);
// Add the main search results body.
const $searchResultBody = $("<div>").css({
maxHeight: `calc(100vh - ${
$targetSearchInput.offset().top - $(window).scrollTop() + 180
}px)`,
overflowY: "auto",
});
$html.append($searchResultBody);
// Append a spinner while we're busy.
const $spinner = createSpinner();
$searchResultBody.append($spinner)
// Display the popover.
const popover = new bootstrap.Popover($targetSearchInput[0], {
content: $html[0],
html: true,
customClass: "td-offline-search-results",
placement: "bottom",
});
popover.show();
//
// Kick off the search, load the results and inject them into the popover.
//
const search = await pagefind.debouncedSearch(searchQuery);
if (search === null) {
// A more recent search call has been made, nothing to do.
return;
}
if (search.results.length === 0) {
$searchResultBody.append(
$("<p>").text(`No results found for query "${searchQuery}"`)
);
} else {
await loadAndRenderResults(search.results, 0, $spinner, $searchResultBody);
}
};
});
})(jQuery);
//
// Helpers
//
const disposePopover = ($targetSearchInput) => {
const popover = bootstrap.Popover.getInstance($targetSearchInput[0]);
if (popover !== null) {
popover.dispose();
}
}
const createSpinner = () => {
return $("<div>")
.addClass("spinner-container")
.append($("<div>")
.addClass("spinner-border")
.attr("role", "status")
.append($("<div>")
.addClass("visually-hidden")
.text("Loading...")))
.append($("<p>")
.text("Loading..."));
}
const loadAndRenderResults = async (results, offset, $spinner, $searchResultBody) => {
// Load and render the first three results and hide the remainder behind a
// button to not freeze the browser by loading results that may not be
// displayed.
const LIMIT = 3;
for (const [index, result] of results.entries()) {
if (index < LIMIT) {
// Insert a container for the result *before* the spinner. This
// will push down the spinner as new content is loaded and keep
// it at the end of the popover.
const $container = $("<div>");
$spinner.before($container);
renderResult(await result.data(), index + offset, $container);
} else if (index === LIMIT) {
const num_hidden_results = results.length - index;
const $loader = $("<button>")
.attr("type", "button")
.addClass("td-offline-search-results__expander-button")
.addClass("btn")
.addClass("btn-sm")
.addClass("btn-link")
.text(`Load more results from ${num_hidden_results} other ${pagesString(num_hidden_results)}`)
.on("click", async () => {
// Remove the button.
$loader.remove();
// Add a spinner while we're busy.
const $spinner = createSpinner();
$searchResultBody.append($spinner)
// Load and render the results.
await loadAndRenderResults(results.slice(LIMIT), LIMIT + offset, $spinner, $searchResultBody);
});
$spinner.before($loader)
}
}
// Remove the spinner now that everything was loaded.
$spinner.remove();
}
const renderResult = (data, index, $container) => {
// Add the main result's page title.
$container.append($("<div>")
.append($("<a>")
.css({
fontSize: "1.2rem",
})
.attr("href", data.url)
.text(data.meta.title))
.append($("<span>")
.addClass("text-body-secondary")
.text(` ${data.sub_results.length} ${resultsString(data.sub_results.length)}`)));
// Render the first 3 subresults per page and wrap the rest
// in a collapsed container.
const LIMIT = 3;
let $wrapper = null;
data.sub_results.forEach((s, index_s) => {
if (index_s === LIMIT) {
const num_hidden_results = data.sub_results.length - index_s;
const wrapper_id = `collapsible-subresults-${index}`;
const $action = $("<span>").text("▶ Show");
const $expander = $("<button>")
.attr("data-bs-toggle", "collapse")
.attr("data-bs-target", `#${wrapper_id}`)
.attr("aria-expanded", "false")
.attr("aria-controls", wrapper_id)
.attr("type", "button")
.addClass("td-offline-search-results__expander-button")
.addClass("btn")
.addClass("btn-sm")
.addClass("btn-link")
.append($action)
.append($("<span>").text(` ${num_hidden_results} more ${resultsString(num_hidden_results)} from ${data.meta.title}`));
$container.append($("<p>").append($expander));
$wrapper = $("<div>")
.addClass("collapse td-offline-search-results__subresults")
.attr("id", wrapper_id)
.on("hide.bs.collapse", _ => $action.text("▶ Show"))
.on("show.bs.collapse", _ => $action.text("▼ Hide"));
$container.append($wrapper);
}
const $entry = $("<div>")
.css("margin-top", "0.5rem");
$entry.append(
$("<a>")
.addClass("d-block")
.attr("href", s.url)
.text(s.title)
);
$entry.append($("<p>").html(s.excerpt));
if (index_s < LIMIT) {
$container.append($entry);
} else {
$wrapper.append($entry);
}
});
};
const resultsString = (n) => {
return n === 1 ? "result" : "results";
};
const pagesString = (n) => {
return n === 1 ? "page" : "pages";
};

View file

@ -661,3 +661,32 @@ dd {
margin: 0;
}
}
/* Style for the page search widget */
.td-offline-search-results {
width: 100%;
max-width: 460px;
}
.td-offline-search-results .td-offline-search-results__subresults.collapse.show {
// Prevent the first child margin from collapsing upward when Bootstrap
// finishes the collapse animation, which otherwise causes a small jump.
display: flow-root;
}
.td-offline-search-results .spinner-container {
text-align: center;
}
.td-offline-search-results__close-button {
// Prevent the label from rendering white on white.
--bs-btn-color: unset;
}
.td-offline-search-results__expander-button {
// Prevent the label from rendering white on white.
--bs-btn-color: unset;
// Avoid any extra inset.
--bs-btn-padding-x: 0;
--bs-btn-padding-y: 0;
}

View file

@ -0,0 +1 @@
Specify `unsigned.replaces_state` in client-formatted events. Contributed by @nexy7574.

View file

@ -0,0 +1 @@
Clarify how to find `via` parameter when following room upgrades.

View file

@ -0,0 +1 @@
Specify `m.key_backup` account data, as per [MSC4287](https://github.com/matrix-org/matrix-spec-proposals/pull/4287).

View file

@ -0,0 +1 @@
Add page search widget.

View file

@ -0,0 +1 @@
Upgrade Docsy theme to v0.14.3.

View file

@ -66,6 +66,7 @@ description = "Home of the Matrix specification for decentralised communication"
[params]
copyright = "The Matrix.org Foundation C.I.C."
offlineSearch = true
[params.version]
# must be one of "unstable", "current", "historical"
@ -151,7 +152,10 @@ sidebar_menu_compact = true
[server.headers.values]
# `style-src 'unsafe-inline'` is needed to correctly render the maths in the Olm spec:
# https://github.com/KaTeX/KaTeX/issues/4096
Content-Security-Policy = "default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self'; img-src 'self' data:; connect-src 'self'; font-src 'self' data:; media-src 'self'; child-src 'self'; form-action 'self'; object-src 'self'"
# `script-src 'unsafe-eval'` is needed because Pagefind relies on it to load its Wasm.
# In future, we should switch to `wasm-unsafe-eval` but this doesn't yet work in Safari:
# https://github.com/Pagefind/pagefind/blob/main/docs/content/docs/hosting.md
Content-Security-Policy = "default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-eval'; img-src 'self' data:; connect-src 'self'; font-src 'self' data:; media-src 'self'; child-src 'self'; form-action 'self'; object-src 'self'"
X-XSS-Protection = "1; mode=block"
X-Content-Type-Options = "nosniff"
# Strict-Transport-Security = "max-age=31536000; includeSubDomains; preload"

View file

@ -1479,6 +1479,43 @@ potential new key backup algorithm version that would fix this issue.
{{% http-api spec="client-server" api="key_backup" %}}
###### Key backup enabled preference
{{% added-in v="1.19" %}}
This enables clients to track a user's preference about enabling or
disabling [server-side backups of room keys](#server-side-key-backups). The data
is stored in the [`m.key_backup`](#mkey_backup) global
[account data](#client-config).
{{% event event="m.key_backup" %}}
When a user signs in to a client which supports encryption and key backup:
* If this event type exists in account data and contains the specified property
in the correct format, clients which support key backup MUST take account of
its contents in their behaviour. For example, clients may automatically turn
on/off key backup based on the property, or prompt the user, using the
property value as a default. (Because this property is server-controlled,
clients may wish to confirm the user's intention.)
* If this event type does not exist in account data, or if it does not contain
the `enabled` property, or if the value of `enabled` is not a boolean value,
clients MUST ignore the existing value and MAY decide whether or not to
perform key backup, possibly based on user input.
If the user turns on key backups, clients MUST set this event type in account
data, to `"enabled": true`.
If the user turns off key backups, clients MUST set this event type in account
data, to `"enabled": false`.
Clients are not required to monitor the `m.key_backup` account data actively.
Clients MAY monitor the setting but should be aware that changing this setting
without user interaction based on choices made in a different client (or a
compromised homeserver) may cause unforeseen security problems or simply be
unexpected by users.
##### Key exports
Keys can be manually exported from one device to an encrypted file,

View file

@ -20,6 +20,10 @@ old room. Another approach may be to virtually merge the rooms such that
the old room's timeline seamlessly continues into the new timeline
without the user having to jump between the rooms.
When joining a room using the room ID in an `m.room.tombstone` event or
`predecessor` field on `m.room.create`, clients SHOULD parse the event
`sender` and use the resulting server name as a `via` parameter.
{{% http-api spec="client-server" api="room_upgrades" %}}
#### Server behaviour

View file

@ -105,9 +105,10 @@ properties:
type: string
prev_content:
description: |
The previous `content` for this event. This field is generated
by the local homeserver, and is only returned if the event is a state event,
and the client has permission to see the previous content.
The `content` of the previous state event that was replaced by this event.
This field is generated by the local homeserver, and is only returned if
the event is a state event, and the client has permission to see the
previous event.
x-changedInMatrixVersion:
"1.2": |
Previously, this field was specified at the top level of returned
@ -117,6 +118,13 @@ properties:
this.
title: EventContent
type: object
replaces_state:
description: |
The event ID of the state event replaced by this event. This field is generated
by the local homeserver, and is only returned if the event is a state event.
Unlike `prev_content`, this field is included regardless of history visibility.
type: string
x-addedInMatrixVersion: "1.19"
membership:
description: |
The room membership of the user making the request, at the time of the event.

View file

@ -0,0 +1,7 @@
{
"$ref": "core/event.json",
"type": "m.key_backup",
"content": {
"enabled": false
}
}

View file

@ -0,0 +1,24 @@
---
$schema: https://json-schema.org/draft/2020-12/schema
allOf:
- $ref: core-event-schema/event.yaml
description: |-
Allows clients to track user preferences about key backup.
properties:
content:
type: object
properties:
enabled:
type: boolean
description: |-
True if the user chose to enable key backup. False if the user chose
to disable key backup.
required:
- enabled
type:
type: string
enum:
- m.key_backup
title: Key Backup Event
type: object

2
go.mod
View file

@ -2,4 +2,4 @@ module github.com/matrix-org/matrix-spec
go 1.12
require github.com/matrix-org/docsy v0.0.0-20260106184755-71d103ebb20a // indirect
require github.com/matrix-org/docsy v0.0.0-20260331222549-f318855c7886 // indirect

4
go.sum
View file

@ -1,4 +1,4 @@
github.com/FortAwesome/Font-Awesome v0.0.0-20241216213156-af620534bfc3/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
github.com/matrix-org/docsy v0.0.0-20260106184755-71d103ebb20a h1:WB3unuZJy7ewAf33sxbtEwYnC+i+Jt1sJpAR3BtzvEo=
github.com/matrix-org/docsy v0.0.0-20260106184755-71d103ebb20a/go.mod h1:mdn1m5HJug6ZddQgrOyCrXNegbtdl5evHiqqbEQLzdI=
github.com/matrix-org/docsy v0.0.0-20260331222549-f318855c7886 h1:+Qowx/XQ8sQGTeVyoyIpcwOcdlB+Ft6x+QJkJEPDIpg=
github.com/matrix-org/docsy v0.0.0-20260331222549-f318855c7886/go.mod h1:mdn1m5HJug6ZddQgrOyCrXNegbtdl5evHiqqbEQLzdI=
github.com/twbs/bootstrap v5.3.8+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=

View file

@ -1,7 +1,7 @@
{{- /*
This is a heading render hook (https://gohugo.io/render-hooks/headings/)
using Docsy's heading self-links hook (https://www.docsy.dev/docs/adding-content/navigation/#heading-self-links).
using Docsy's heading self-links hook (https://www.docsy.dev/docs/content/navigation/#heading-self-links).
This is used when a heading is encountered in markdown content to generate
the HTML for that heading. A self-link anchor is added at the end of the

View file

@ -2,7 +2,6 @@
A copy of the navbar.html partial in Docsy, modified to:
* remove `data-bs-theme` at L20, otherwise the title disappears on hover.
* replace the site title with "specification" at L31.
* include the spec version from the config at L34-35, which is calculated
using an inline `version-string` partial.
@ -16,7 +15,8 @@
{{ $baseURL := urls.Parse $.Site.Params.Baseurl -}}
<nav class="td-navbar js-navbar-scroll
{{- if $cover }} td-navbar-cover {{- end }}">
{{- if $cover }} td-navbar-cover td-navbar-transparent {{- end }}"
{{- if eq (.Param "ui.navbar_theme") "dark" }} data-bs-theme="dark" {{- end }}>
<div class="td-navbar-container container-fluid flex-column flex-md-row">
<a class="navbar-brand" href="{{ .Site.Home.RelPermalink }}">
{{- /**/ -}}
@ -35,7 +35,7 @@
<span class="navbar-version"> &mdash; {{ partial "version-string" . }}</span>
{{- /**/ -}}
</a>
<div class="td-navbar-nav-scroll td-navbar-nav-scroll--indicator" id="main_navbar">
<div class="td-navbar__main td-navbar-nav-scroll td-navbar-nav-scroll--indicator" id="main_navbar">
<div class="scroll-indicator scroll-left"></div>
<ul class="navbar-nav">
{{ $p := . -}}
@ -80,7 +80,7 @@
</ul>
<div class="scroll-indicator scroll-right"></div>
</div>
<div class="d-none d-lg-block td-navbar__search">
<div class="td-navbar__search d-none d-lg-block">
{{ partial "search-input.html" . }}
</div>
</div>

View file

@ -0,0 +1,10 @@
<div class="td-search td-search--offline">
<div class="td-search__icon"></div>
<input
type="search"
class="td-search__input form-control"
placeholder="Search the spec"
aria-label="Search the spec"
autocomplete="off"
>
</div>

View file

@ -14,6 +14,7 @@
{{ $cacheSidebar := .cacheSidebar -}}
{{ with $context -}}
{{/* When the sidebar is cached, "active" class is set client side. */ -}}
{{ $shouldDelayActive := $cacheSidebar -}}
@ -174,7 +175,7 @@
{{- end -}}
<span class="
{{- if $active }}td-sidebar-nav-active-item{{ end -}}
{{- if and $s.Params.sidebar_root_for site.Params.ui.sidebar_root_enabled }} td-sidebar-root-up-icon{{ end -}}
{{- if and $treeRoot $s.Params.sidebar_root_for site.Params.ui.sidebar_root_enabled }} td-sidebar-root-up-icon{{ end -}}
">
{{- $s.LinkTitle -}}
</span></a>
@ -190,4 +191,4 @@
</ul>
{{- end }}
</li>
{{- end }}
{{- end -}}

159
package-lock.json generated
View file

@ -12,6 +12,7 @@
"@fullhuman/postcss-purgecss": "^6.0.0",
"autoprefixer": "^10.4.20",
"node-fetch": "^2.6.7",
"pagefind": "^1.4.0",
"postcss": "^8.4.49",
"postcss-cli": "^11.0.0"
}
@ -170,6 +171,90 @@
"node": ">= 8"
}
},
"node_modules/@pagefind/darwin-arm64": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/@pagefind/darwin-arm64/-/darwin-arm64-1.4.0.tgz",
"integrity": "sha512-2vMqkbv3lbx1Awea90gTaBsvpzgRs7MuSgKDxW0m9oV1GPZCZbZBJg/qL83GIUEN2BFlY46dtUZi54pwH+/pTQ==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
]
},
"node_modules/@pagefind/darwin-x64": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/@pagefind/darwin-x64/-/darwin-x64-1.4.0.tgz",
"integrity": "sha512-e7JPIS6L9/cJfow+/IAqknsGqEPjJnVXGjpGm25bnq+NPdoD3c/7fAwr1OXkG4Ocjx6ZGSCijXEV4ryMcH2E3A==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
]
},
"node_modules/@pagefind/freebsd-x64": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/@pagefind/freebsd-x64/-/freebsd-x64-1.4.0.tgz",
"integrity": "sha512-WcJVypXSZ+9HpiqZjFXMUobfFfZZ6NzIYtkhQ9eOhZrQpeY5uQFqNWLCk7w9RkMUwBv1HAMDW3YJQl/8OqsV0Q==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"freebsd"
]
},
"node_modules/@pagefind/linux-arm64": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/@pagefind/linux-arm64/-/linux-arm64-1.4.0.tgz",
"integrity": "sha512-PIt8dkqt4W06KGmQjONw7EZbhDF+uXI7i0XtRLN1vjCUxM9vGPdtJc2mUyVPevjomrGz5M86M8bqTr6cgDp1Uw==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@pagefind/linux-x64": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/@pagefind/linux-x64/-/linux-x64-1.4.0.tgz",
"integrity": "sha512-z4oddcWwQ0UHrTHR8psLnVlz6USGJ/eOlDPTDYZ4cI8TK8PgwRUPQZp9D2iJPNIPcS6Qx/E4TebjuGJOyK8Mmg==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
]
},
"node_modules/@pagefind/windows-x64": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/@pagefind/windows-x64/-/windows-x64-1.4.0.tgz",
"integrity": "sha512-NkT+YAdgS2FPCn8mIA9bQhiBs+xmniMGq1LFPDhcFn0+2yIUEiIG06t7bsZlhdjknEQRTSdT7YitP6fC5qwP0g==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
]
},
"node_modules/@pkgjs/parseargs": {
"version": "0.11.0",
"resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",
@ -914,6 +999,24 @@
"dev": true,
"license": "BlueOak-1.0.0"
},
"node_modules/pagefind": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/pagefind/-/pagefind-1.4.0.tgz",
"integrity": "sha512-z2kY1mQlL4J8q5EIsQkLzQjilovKzfNVhX8De6oyE6uHpfFtyBaqUpcl/XzJC/4fjD8vBDyh1zolimIcVrCn9g==",
"dev": true,
"license": "MIT",
"bin": {
"pagefind": "lib/runner/bin.cjs"
},
"optionalDependencies": {
"@pagefind/darwin-arm64": "1.4.0",
"@pagefind/darwin-x64": "1.4.0",
"@pagefind/freebsd-x64": "1.4.0",
"@pagefind/linux-arm64": "1.4.0",
"@pagefind/linux-x64": "1.4.0",
"@pagefind/windows-x64": "1.4.0"
}
},
"node_modules/path-key": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
@ -1652,6 +1755,48 @@
"fastq": "^1.6.0"
}
},
"@pagefind/darwin-arm64": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/@pagefind/darwin-arm64/-/darwin-arm64-1.4.0.tgz",
"integrity": "sha512-2vMqkbv3lbx1Awea90gTaBsvpzgRs7MuSgKDxW0m9oV1GPZCZbZBJg/qL83GIUEN2BFlY46dtUZi54pwH+/pTQ==",
"dev": true,
"optional": true
},
"@pagefind/darwin-x64": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/@pagefind/darwin-x64/-/darwin-x64-1.4.0.tgz",
"integrity": "sha512-e7JPIS6L9/cJfow+/IAqknsGqEPjJnVXGjpGm25bnq+NPdoD3c/7fAwr1OXkG4Ocjx6ZGSCijXEV4ryMcH2E3A==",
"dev": true,
"optional": true
},
"@pagefind/freebsd-x64": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/@pagefind/freebsd-x64/-/freebsd-x64-1.4.0.tgz",
"integrity": "sha512-WcJVypXSZ+9HpiqZjFXMUobfFfZZ6NzIYtkhQ9eOhZrQpeY5uQFqNWLCk7w9RkMUwBv1HAMDW3YJQl/8OqsV0Q==",
"dev": true,
"optional": true
},
"@pagefind/linux-arm64": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/@pagefind/linux-arm64/-/linux-arm64-1.4.0.tgz",
"integrity": "sha512-PIt8dkqt4W06KGmQjONw7EZbhDF+uXI7i0XtRLN1vjCUxM9vGPdtJc2mUyVPevjomrGz5M86M8bqTr6cgDp1Uw==",
"dev": true,
"optional": true
},
"@pagefind/linux-x64": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/@pagefind/linux-x64/-/linux-x64-1.4.0.tgz",
"integrity": "sha512-z4oddcWwQ0UHrTHR8psLnVlz6USGJ/eOlDPTDYZ4cI8TK8PgwRUPQZp9D2iJPNIPcS6Qx/E4TebjuGJOyK8Mmg==",
"dev": true,
"optional": true
},
"@pagefind/windows-x64": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/@pagefind/windows-x64/-/windows-x64-1.4.0.tgz",
"integrity": "sha512-NkT+YAdgS2FPCn8mIA9bQhiBs+xmniMGq1LFPDhcFn0+2yIUEiIG06t7bsZlhdjknEQRTSdT7YitP6fC5qwP0g==",
"dev": true,
"optional": true
},
"@pkgjs/parseargs": {
"version": "0.11.0",
"resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",
@ -2117,6 +2262,20 @@
"integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==",
"dev": true
},
"pagefind": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/pagefind/-/pagefind-1.4.0.tgz",
"integrity": "sha512-z2kY1mQlL4J8q5EIsQkLzQjilovKzfNVhX8De6oyE6uHpfFtyBaqUpcl/XzJC/4fjD8vBDyh1zolimIcVrCn9g==",
"dev": true,
"requires": {
"@pagefind/darwin-arm64": "1.4.0",
"@pagefind/darwin-x64": "1.4.0",
"@pagefind/freebsd-x64": "1.4.0",
"@pagefind/linux-arm64": "1.4.0",
"@pagefind/linux-x64": "1.4.0",
"@pagefind/windows-x64": "1.4.0"
}
},
"path-key": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",

View file

@ -5,7 +5,8 @@
"main": "none.js",
"scripts": {
"get-proposals": "node ./scripts/proposals.js",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"pagefind": "pagefind $@"
},
"repository": {
"type": "git",
@ -22,6 +23,7 @@
"@fullhuman/postcss-purgecss": "^6.0.0",
"autoprefixer": "^10.4.20",
"node-fetch": "^2.6.7",
"pagefind": "^1.4.0",
"postcss": "^8.4.49",
"postcss-cli": "^11.0.0"
}