From 0cc0a5b2cabdc351bb5801c824535c5f2958bdec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Thu, 24 Oct 2024 00:23:48 +0200 Subject: [PATCH 01/10] Upgrade docsy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 7988b29ff..d17af3038 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module github.com/matrix-org/matrix-spec go 1.12 -require github.com/matrix-org/docsy v0.0.0-20231227121313-d55dbaf3aaaf // indirect +require github.com/matrix-org/docsy v0.0.0-20241030165433-a14705b7e3ca // indirect diff --git a/go.sum b/go.sum index 1fb47ebda..d76f35349 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,4 @@ github.com/FortAwesome/Font-Awesome v0.0.0-20230327165841-0698449d50f2/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo= -github.com/matrix-org/docsy v0.0.0-20231227121313-d55dbaf3aaaf h1:e1mutHvMYJ92F/VkAp2ixQthXf6zNHJll4wYGbBHznI= -github.com/matrix-org/docsy v0.0.0-20231227121313-d55dbaf3aaaf/go.mod h1:TAN2cSMJzy0hnx9OYDbBYluS8raV61UHxT/tfjaLt3g= +github.com/matrix-org/docsy v0.0.0-20241030165433-a14705b7e3ca h1:WqKYQIF3JdWxY6b+OZQbdCjczOmELuUxpXhXSXJ/F58= +github.com/matrix-org/docsy v0.0.0-20241030165433-a14705b7e3ca/go.mod h1:TAN2cSMJzy0hnx9OYDbBYluS8raV61UHxT/tfjaLt3g= github.com/twbs/bootstrap v5.2.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0= From 0395528829abbd6f33ea5490306a3659aa5e1bfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Thu, 24 Oct 2024 00:36:53 +0200 Subject: [PATCH 02/10] Always use relative paths for spec links MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- changelogs/header.md | 2 +- content/changelog/v1.1.md | 2 +- content/changelog/v1.10.md | 2 +- content/changelog/v1.11.md | 2 +- content/changelog/v1.12.md | 2 +- content/changelog/v1.2.md | 2 +- content/changelog/v1.3.md | 2 +- content/changelog/v1.4.md | 2 +- content/changelog/v1.5.md | 2 +- content/changelog/v1.6.md | 2 +- content/changelog/v1.7.md | 2 +- content/changelog/v1.8.md | 2 +- content/changelog/v1.9.md | 2 +- data/string-formats.yaml | 10 +++++----- layouts/404.html | 2 +- layouts/partials/hooks/head-end.html | 4 ++-- layouts/partials/openapi/render-object-table.html | 2 +- 17 files changed, 22 insertions(+), 22 deletions(-) diff --git a/changelogs/header.md b/changelogs/header.md index a8fd04ba3..21f3b4d27 100644 --- a/changelogs/header.md +++ b/changelogs/header.md @@ -9,7 +9,7 @@ Variables: - +
Git commithttps://github.com/matrix-org/matrix-spec/tree/VERSION
Release dateDATE
Checklistchecklist.md
Checklist}}">checklist.md
diff --git a/content/changelog/v1.1.md b/content/changelog/v1.1.md index 91a795812..7e31122dd 100644 --- a/content/changelog/v1.1.md +++ b/content/changelog/v1.1.md @@ -18,7 +18,7 @@ Variables: - +
Git commithttps://github.com/matrix-org/matrix-doc/tree/v1.1
Release dateNovember 09, 2021
Checklistchecklist.md
Checklist}}">checklist.md
diff --git a/content/changelog/v1.10.md b/content/changelog/v1.10.md index 38fb05018..8a0e496d1 100644 --- a/content/changelog/v1.10.md +++ b/content/changelog/v1.10.md @@ -18,7 +18,7 @@ Variables: - +
Git commithttps://github.com/matrix-org/matrix-spec/tree/v1.10
Release dateMarch 22, 2024
Checklistchecklist.md
Checklist}}">checklist.md
diff --git a/content/changelog/v1.11.md b/content/changelog/v1.11.md index cb20f57b4..d38d874bc 100644 --- a/content/changelog/v1.11.md +++ b/content/changelog/v1.11.md @@ -18,7 +18,7 @@ Variables: - +
Git commithttps://github.com/matrix-org/matrix-spec/tree/v1.11
Release dateJune 20, 2024
Checklistchecklist.md
Checklist}}">checklist.md
diff --git a/content/changelog/v1.12.md b/content/changelog/v1.12.md index 61c2cc805..8124ca28d 100644 --- a/content/changelog/v1.12.md +++ b/content/changelog/v1.12.md @@ -18,7 +18,7 @@ Variables: - +
Git commithttps://github.com/matrix-org/matrix-spec/tree/v1.12
Release dateOctober 07, 2024
Checklistchecklist.md
Checklist}}">checklist.md
diff --git a/content/changelog/v1.2.md b/content/changelog/v1.2.md index 5f06e8a71..224da53fd 100644 --- a/content/changelog/v1.2.md +++ b/content/changelog/v1.2.md @@ -18,7 +18,7 @@ Variables: - +
Git commithttps://github.com/matrix-org/matrix-doc/tree/v1.2
Release dateFebruary 02, 2022
Checklistchecklist.md
Checklist}}">checklist.md
diff --git a/content/changelog/v1.3.md b/content/changelog/v1.3.md index 46e7f0d45..b8c99a7c1 100644 --- a/content/changelog/v1.3.md +++ b/content/changelog/v1.3.md @@ -18,7 +18,7 @@ Variables: - +
Git commithttps://github.com/matrix-org/matrix-spec/tree/v1.3
Release dateJune 15, 2022
Checklistchecklist.md
Checklist}}">checklist.md
diff --git a/content/changelog/v1.4.md b/content/changelog/v1.4.md index 6515e5708..10510d806 100644 --- a/content/changelog/v1.4.md +++ b/content/changelog/v1.4.md @@ -18,7 +18,7 @@ Variables: - +
Git commithttps://github.com/matrix-org/matrix-spec/tree/v1.4
Release dateSeptember 29, 2022
Checklistchecklist.md
Checklist}}">checklist.md
diff --git a/content/changelog/v1.5.md b/content/changelog/v1.5.md index cc099ebe8..9f23a019b 100644 --- a/content/changelog/v1.5.md +++ b/content/changelog/v1.5.md @@ -18,7 +18,7 @@ Variables: - +
Git commithttps://github.com/matrix-org/matrix-spec/tree/v1.5
Release dateNovember 17, 2022
Checklistchecklist.md
Checklist}}">checklist.md
diff --git a/content/changelog/v1.6.md b/content/changelog/v1.6.md index d0e14a0ab..d47c36b5a 100644 --- a/content/changelog/v1.6.md +++ b/content/changelog/v1.6.md @@ -18,7 +18,7 @@ Variables: - +
Git commithttps://github.com/matrix-org/matrix-spec/tree/v1.6
Release dateFebruary 14, 2023
Checklistchecklist.md
Checklist}}">checklist.md
diff --git a/content/changelog/v1.7.md b/content/changelog/v1.7.md index 8cbe19854..f4b2b63e6 100644 --- a/content/changelog/v1.7.md +++ b/content/changelog/v1.7.md @@ -18,7 +18,7 @@ Variables: - +
Git commithttps://github.com/matrix-org/matrix-spec/tree/v1.7
Release dateMay 25, 2023
Checklistchecklist.md
Checklist}}">checklist.md
diff --git a/content/changelog/v1.8.md b/content/changelog/v1.8.md index 2ff0e7a4e..1883d10ad 100644 --- a/content/changelog/v1.8.md +++ b/content/changelog/v1.8.md @@ -18,7 +18,7 @@ Variables: - +
Git commithttps://github.com/matrix-org/matrix-spec/tree/v1.8
Release dateAugust 23, 2023
Checklistchecklist.md
Checklist}}">checklist.md
diff --git a/content/changelog/v1.9.md b/content/changelog/v1.9.md index 6679dd985..a3971bd2a 100644 --- a/content/changelog/v1.9.md +++ b/content/changelog/v1.9.md @@ -18,7 +18,7 @@ Variables: - +
Git commithttps://github.com/matrix-org/matrix-spec/tree/v1.9
Release dateNovember 29, 2023
Checklistchecklist.md
Checklist}}">checklist.md
diff --git a/data/string-formats.yaml b/data/string-formats.yaml index e4ebc523a..39eaa1a1e 100644 --- a/data/string-formats.yaml +++ b/data/string-formats.yaml @@ -38,27 +38,27 @@ mx-user-id: title: User ID - url: /appendices#user-identifiers + url: appendices#user-identifiers # regex: "^@" mx-event-id: title: Event ID - url: /appendices#event-ids + url: appendices#event-ids # regex: "^\\$" mx-room-id: title: Room ID - url: /appendices#room-ids + url: appendices#room-ids # regex: "^!" mx-server-name: title: Server Name - url: /appendices#server-name + url: appendices#server-name # no regex mx-mxc-uri: title: Matrix Content URI - url: /client-server-api#matrix-content-mxc-uris + url: client-server-api#matrix-content-mxc-uris # regex: "^mxc:\\/\\/" uri: diff --git a/layouts/404.html b/layouts/404.html index 212e20bae..c8a3523ba 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -2,7 +2,7 @@

Not found

-

This page doesn't exist. Try going back to the main page for the Matrix Specification.

+

This page doesn't exist. Try going back to the main page for the Matrix Specification.

{{ end }} diff --git a/layouts/partials/hooks/head-end.html b/layouts/partials/hooks/head-end.html index 9ce7e3e53..c01536699 100644 --- a/layouts/partials/hooks/head-end.html +++ b/layouts/partials/hooks/head-end.html @@ -13,5 +13,5 @@ Google Fonts manually via a script: https://github.com/matrix-org/matrix-spec/tree/main/static/css/fonts */}} - - + + diff --git a/layouts/partials/openapi/render-object-table.html b/layouts/partials/openapi/render-object-table.html index c757140fc..bae7a3d9f 100644 --- a/layouts/partials/openapi/render-object-table.html +++ b/layouts/partials/openapi/render-object-table.html @@ -335,7 +335,7 @@ {{ $stringFormat := "" }} {{ with index site.Data "string-formats" . }} - {{ $stringFormat = printf "%s" (htmlEscape .url) (htmlEscape .title) }} + {{ $stringFormat = printf "%s" (htmlEscape .url | relURL) (htmlEscape .title) }} {{ end }} {{ return $stringFormat }} From 28a730339dc70e8375e760980b83ab76410cc42c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Thu, 24 Oct 2024 00:38:27 +0200 Subject: [PATCH 03/10] Define asset sources in Hugo config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Helps Hugo to generate the correct links for files in /static. Signed-off-by: Kévin Commaille --- config.toml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/config.toml b/config.toml index 06c11ad6b..041d5ea0a 100644 --- a/config.toml +++ b/config.toml @@ -138,6 +138,15 @@ sidebar_menu_compact = true [[module.imports]] path = "github.com/matrix-org/docsy" disable = false + # Mounting /assets and /static as assets directories helps Hugo to generate + # the correct URL. + [[module.mounts]] + source = 'assets' + target = 'assets' + [[module.mounts]] + source = 'static' + target = 'assets' + # custom output formats From 7cf66f9007e17f93a53a695b58b79b636c1bba21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Thu, 24 Oct 2024 00:39:54 +0200 Subject: [PATCH 04/10] Disable canonifyURLs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is deprecated and messes with relative links when used with some baseURLs. Signed-off-by: Kévin Commaille --- config.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/config.toml b/config.toml index 041d5ea0a..8bede6905 100644 --- a/config.toml +++ b/config.toml @@ -1,10 +1,6 @@ baseURL = "/" title = "Matrix Specification" -# Prepends absolute URLs with the baseURL. Useful when hosting on non-root -# paths, such as /unstable. -canonifyURLs = true - enableRobotsTXT = true # We disable RSS, because (a) it's useless, (b) Hugo seems to generate broken From fbe57e9937358958b184216c34cdd360f7085221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Thu, 24 Oct 2024 00:41:14 +0200 Subject: [PATCH 05/10] Enable checklist as an alternative format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that relative links are fixed, having it enabled is not a problem anymore. Signed-off-by: Kévin Commaille --- config.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/config.toml b/config.toml index 8bede6905..581214b20 100644 --- a/config.toml +++ b/config.toml @@ -151,4 +151,3 @@ sidebar_menu_compact = true mediaType = "text/markdown" isPlainText = true baseName = "checklist" - notAlternative = true From e60156f4a29a7893d69b1673f2d9f53d7ae560bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Thu, 24 Oct 2024 12:35:22 +0200 Subject: [PATCH 06/10] Add changelog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- changelogs/internal/newsfragments/1984.clarification | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/internal/newsfragments/1984.clarification diff --git a/changelogs/internal/newsfragments/1984.clarification b/changelogs/internal/newsfragments/1984.clarification new file mode 100644 index 000000000..cb11abe65 --- /dev/null +++ b/changelogs/internal/newsfragments/1984.clarification @@ -0,0 +1 @@ +Fix relative URLs when serving the specification with a custom `baseURL`. From 0ef87aa34fb69f8bebae9726cff706ba0d32e261 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Thu, 24 Oct 2024 12:48:18 +0200 Subject: [PATCH 07/10] Upgrade the version of Hugo used in CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise the `relref` in the changelogs does not work. Version 0.124.1 is the last version of Hugo to work with the current version of the docsy theme. Signed-off-by: Kévin Commaille --- .github/workflows/main.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8db6359f2..d67cd441b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,9 @@ name: "Spec" + +env: + # Cannot build the spec with Hugo 0.125.0 and docsy < 0.10.0 because of https://github.com/google/docsy/issues/1930 + HUGO_VERSION: 0.124.1 + on: push: branches: @@ -193,7 +198,7 @@ jobs: - name: "➕ Setup Hugo" uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f # v3.0.0 with: - hugo-version: '0.117.0' + hugo-version: ${{ env.HUGO_VERSION }} extended: true - name: "📥 Source checkout" uses: actions/checkout@v4 @@ -270,8 +275,7 @@ jobs: - name: "➕ Setup Hugo" uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f # v3.0.0 with: - # Cannot build the spec with Hugo 0.125.0 because of https://github.com/google/docsy/issues/1930 - hugo-version: '0.124.1' + hugo-version: ${{ env.HUGO_VERSION }} extended: true - name: "📥 Source checkout" uses: actions/checkout@v4 From a4306c382ab8c7055c88e61701dc33f4f7e033f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Thu, 24 Oct 2024 16:46:32 +0200 Subject: [PATCH 08/10] Do not call `markdownify` in alert partial MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This causes issues for links as the method doesn't have the right context to resolve them. The content is already markdownified because of the `%` syntax of the shortcode that calls it, and it has the right context. Signed-off-by: Kévin Commaille --- layouts/partials/alert.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/alert.html b/layouts/partials/alert.html index 9096769f5..91dd6799f 100644 --- a/layouts/partials/alert.html +++ b/layouts/partials/alert.html @@ -16,5 +16,5 @@ {{ $omit_title := .omit_title }} From a493acb489619ec51708019beaf7c85cab1afb9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Thu, 24 Oct 2024 16:53:45 +0200 Subject: [PATCH 09/10] Fix links in OpenAPI data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Links that contain only a fragment are not resolved by Hugo so the final relative URL is wrong. They also cause problems for the OpenAPI definitions because these links are not edited in the dump-openapi script so they end up broken. Signed-off-by: Kévin Commaille --- data/api/client-server/account-data.yaml | 4 +-- data/api/client-server/appservice_ping.yaml | 4 +-- .../client-server/definitions/auth_data.yaml | 2 +- .../definitions/key_backup_session_data.yaml | 3 ++- .../megolm_export_session_data.yaml | 4 +-- .../definitions/timeline_batch.yaml | 2 +- data/api/client-server/old_sync.yaml | 4 +-- .../room_event_by_timestamp.yaml | 2 +- data/api/client-server/room_initial_sync.yaml | 4 +-- data/api/client-server/space_hierarchy.yaml | 12 ++++----- data/api/client-server/sync.yaml | 27 ++++++++++--------- data/api/client-server/whoami.yaml | 6 ++--- data/api/server-server/events.yaml | 4 +-- data/api/server-server/joins-v1.yaml | 2 +- data/api/server-server/space_hierarchy.yaml | 4 +-- .../schema/m.forwarded_room_key.yaml | 2 +- .../schema/m.key.verification.request.yaml | 3 ++- data/event-schemas/schema/m.room.create.yaml | 3 ++- .../schema/m.room.encrypted.yaml | 11 ++++---- data/event-schemas/schema/m.room.member.yaml | 2 +- ...om.message$m.key.verification.request.yaml | 2 +- data/event-schemas/schema/m.room_key.yaml | 2 +- .../schema/m.room_key_request.yaml | 4 +-- data/event-schemas/schema/m.secret.send.yaml | 3 ++- data/event-schemas/schema/m.space.child.yaml | 2 +- 25 files changed, 63 insertions(+), 55 deletions(-) diff --git a/data/api/client-server/account-data.yaml b/data/api/client-server/account-data.yaml index 8fda4c39b..fea15d95e 100644 --- a/data/api/client-server/account-data.yaml +++ b/data/api/client-server/account-data.yaml @@ -23,7 +23,7 @@ paths: Set some account data for the client. This config is only visible to the user that set the account data. The config will be available to clients through the top-level `account_data` field in the homeserver response to - [/sync](#get_matrixclientv3sync). + [/sync](/client-server-api/#get_matrixclientv3sync). operationId: setAccountData security: - accessTokenQuery: [] @@ -185,7 +185,7 @@ paths: description: |- Set some account data for the client on a given room. This config is only visible to the user that set the account data. The config will be delivered to - clients in the per-room entries via [/sync](#get_matrixclientv3sync). + clients in the per-room entries via [/sync](/client-server-api/#get_matrixclientv3sync). operationId: setAccountDataPerRoom security: - accessTokenQuery: [] diff --git a/data/api/client-server/appservice_ping.yaml b/data/api/client-server/appservice_ping.yaml index 5596119ed..ed84a089a 100644 --- a/data/api/client-server/appservice_ping.yaml +++ b/data/api/client-server/appservice_ping.yaml @@ -23,7 +23,7 @@ paths: connection works. description: |- This API asks the homeserver to call the - [`/_matrix/app/v1/ping`](#post_matrixappv1ping) endpoint on the + [`/_matrix/app/v1/ping`](/application-service-api/#post_matrixappv1ping) endpoint on the application service to ensure that the homeserver can communicate with the application service. @@ -71,7 +71,7 @@ paths: type: integer description: |- The duration in milliseconds that the - [`/_matrix/app/v1/ping`](#post_matrixappv1ping) + [`/_matrix/app/v1/ping`](/application-service-api/#post_matrixappv1ping) request took from the homeserver's point of view. required: - duration_ms diff --git a/data/api/client-server/definitions/auth_data.yaml b/data/api/client-server/definitions/auth_data.yaml index 691cdc651..0186b24e2 100644 --- a/data/api/client-server/definitions/auth_data.yaml +++ b/data/api/client-server/definitions/auth_data.yaml @@ -21,7 +21,7 @@ properties: The authentication type that the client is attempting to complete. May be omitted if `session` is given, and the client is reissuing a request which it believes has been completed out-of-band (for example, - via the [fallback mechanism](#fallback)). + via the [fallback mechanism](/client-server-api/#fallback)). type: string session: description: The value of the session key given by the homeserver. diff --git a/data/api/client-server/definitions/key_backup_session_data.yaml b/data/api/client-server/definitions/key_backup_session_data.yaml index bc61bb300..e25791420 100644 --- a/data/api/client-server/definitions/key_backup_session_data.yaml +++ b/data/api/client-server/definitions/key_backup_session_data.yaml @@ -28,7 +28,8 @@ properties: items: type: string description: |- - Chain of Curve25519 keys through which this session was forwarded, via [m.forwarded_room_key](#mforwarded_room_key) events. + Chain of Curve25519 keys through which this session was forwarded, via [m.forwarded_room_key](/client-server-api/#mforwarded_room_key) + events. sender_key: type: string description: |- diff --git a/data/api/client-server/definitions/megolm_export_session_data.yaml b/data/api/client-server/definitions/megolm_export_session_data.yaml index f5d1e4092..ac4e49458 100644 --- a/data/api/client-server/definitions/megolm_export_session_data.yaml +++ b/data/api/client-server/definitions/megolm_export_session_data.yaml @@ -21,8 +21,8 @@ allOf: The format used to encode a Megolm session key for export. This is similar to the format before encryption used for the session keys - in [Server-side key backups](#server-side-key-backups) but adds the - `room_id` and `session_id` fields. + in [Server-side key backups](/client-server-api/#server-side-key-backups) + but adds the `room_id` and `session_id` fields. properties: room_id: type: string diff --git a/data/api/client-server/definitions/timeline_batch.yaml b/data/api/client-server/definitions/timeline_batch.yaml index 1c4ba40ee..5b95f5834 100644 --- a/data/api/client-server/definitions/timeline_batch.yaml +++ b/data/api/client-server/definitions/timeline_batch.yaml @@ -19,7 +19,7 @@ properties: type: boolean prev_batch: description: A token that can be supplied to the `from` parameter of the - [`/rooms//messages`](#get_matrixclientv3roomsroomidmessages) + [`/rooms//messages`](/client-server-api/#get_matrixclientv3roomsroomidmessages) endpoint in order to retrieve earlier events. If no earlier events are available, this property may be omitted from diff --git a/data/api/client-server/old_sync.yaml b/data/api/client-server/old_sync.yaml index a1d0f4979..0a3c04392 100644 --- a/data/api/client-server/old_sync.yaml +++ b/data/api/client-server/old_sync.yaml @@ -173,7 +173,7 @@ paths: description: |- A token which correlates to the start of `chunk`. Can be passed to - [`/rooms//messages`](#get_matrixclientv3roomsroomidmessages) + [`/rooms//messages`](/client-server-api/#get_matrixclientv3roomsroomidmessages) to retrieve earlier events. If no earlier events are available, this property may be omitted from @@ -183,7 +183,7 @@ paths: description: |- A token which correlates to the end of `chunk`. Can be passed to - [`/rooms//messages`](#get_matrixclientv3roomsroomidmessages) + [`/rooms//messages`](/client-server-api/#get_matrixclientv3roomsroomidmessages) to retrieve later events. chunk: type: array diff --git a/data/api/client-server/room_event_by_timestamp.yaml b/data/api/client-server/room_event_by_timestamp.yaml index 232950f5a..1ab52cb91 100644 --- a/data/api/client-server/room_event_by_timestamp.yaml +++ b/data/api/client-server/room_event_by_timestamp.yaml @@ -30,7 +30,7 @@ paths: to ask other servers for a suitable event. After calling this endpoint, clients can call - [`/rooms/{roomId}/context/{eventId}`](#get_matrixclientv3roomsroomidcontexteventid) + [`/rooms/{roomId}/context/{eventId}`](/client-server-api/#get_matrixclientv3roomsroomidcontexteventid) to obtain a pagination token to retrieve the events around the returned event. The event returned by this endpoint could be an event that the client diff --git a/data/api/client-server/room_initial_sync.yaml b/data/api/client-server/room_initial_sync.yaml index 6b34f331c..7b70bacb5 100644 --- a/data/api/client-server/room_initial_sync.yaml +++ b/data/api/client-server/room_initial_sync.yaml @@ -54,7 +54,7 @@ paths: type: string description: |- A token which correlates to the start of `chunk`. Can be passed to - [`/rooms//messages`](#get_matrixclientv3roomsroomidmessages) + [`/rooms//messages`](/client-server-api/#get_matrixclientv3roomsroomidmessages) to retrieve earlier events. If no earlier events are available, this property may be omitted from @@ -63,7 +63,7 @@ paths: type: string description: |- A token which correlates to the end of `chunk`. Can be passed to - [`/rooms//messages`](#get_matrixclientv3roomsroomidmessages) + [`/rooms//messages`](/client-server-api/#get_matrixclientv3roomsroomidmessages) to retrieve later events. chunk: type: array diff --git a/data/api/client-server/space_hierarchy.yaml b/data/api/client-server/space_hierarchy.yaml index 8378aee0f..6329495ce 100644 --- a/data/api/client-server/space_hierarchy.yaml +++ b/data/api/client-server/space_hierarchy.yaml @@ -26,8 +26,8 @@ paths: Where a child room is unknown to the local server, federation is used to fill in the details. The servers listed in the `via` array should be contacted to attempt to fill in missing rooms. - Only [`m.space.child`](#mspacechild) state events of the room are considered. Invalid child - rooms and parent events are not covered by this endpoint. + Only [`m.space.child`](/client-server-api/#mspacechild) state events of the room are considered. + Invalid child rooms and parent events are not covered by this endpoint. operationId: getSpaceHierarchy security: - accessTokenQuery: [] @@ -44,8 +44,8 @@ paths: name: suggested_only description: |- Optional (default `false`) flag to indicate whether or not the server should only consider - suggested rooms. Suggested rooms are annotated in their [`m.space.child`](#mspacechild) event - contents. + suggested rooms. Suggested rooms are annotated in their [`m.space.child`](/client-server-api/#mspacechild) + event contents. example: true schema: type: boolean @@ -103,8 +103,8 @@ paths: children_state: type: array description: |- - The [`m.space.child`](#mspacechild) events of the space-room, represented - as [Stripped State Events](#stripped-state) with an added `origin_server_ts` key. + The [`m.space.child`](/client-server-api/#mspacechild) events of the space-room, represented + as [Stripped State Events](/client-server-api/#stripped-state) with an added `origin_server_ts` key. If the room is not a space-room, this should be empty. items: diff --git a/data/api/client-server/sync.yaml b/data/api/client-server/sync.yaml index efe36c5cb..1122f28f0 100644 --- a/data/api/client-server/sync.yaml +++ b/data/api/client-server/sync.yaml @@ -223,8 +223,8 @@ paths: The new ephemeral events in the room (events that aren't recorded in the timeline or state of the room). In this version of the spec, these are - [typing notification](#typing-notifications) and - [read receipt](#receipts) events. + [typing notification](/client-server-api/#typing-notifications) + and [read receipt](/client-server-api/#receipts) events. allOf: - $ref: definitions/event_batch.yaml account_data: @@ -245,7 +245,7 @@ paths: If `unread_thread_notifications` was specified as `true` on the `RoomEventFilter`, these counts will only be for the main timeline rather than all events in the room. - See the [threading module](#threading) for more information. + See the [threading module](/client-server-api/#threading) for more information. x-changedInMatrixVersion: "1.4": | Updated to reflect behaviour of having `unread_thread_notifications` as `true` in @@ -265,8 +265,8 @@ paths: type: object description: |- If `unread_thread_notifications` was specified as `true` on the `RoomEventFilter`, - the notification counts for each [thread](#threading) in this room. The object is - keyed by thread root ID, with values matching `unread_notifications`. + the notification counts for each [thread](/client-server-api/#threading) in this room. + The object is keyed by thread root ID, with values matching `unread_notifications`. If a thread does not have any notifications it can be omitted from this object. If no threads have notification counts, this whole object can be omitted. @@ -302,12 +302,13 @@ paths: title: InviteState type: object description: |- - The [stripped state](#stripped-state) of a room that the user has been invited - to. + The [stripped state](/client-server-api/#stripped-state) of a room that the user has + been invited to. properties: events: - description: The [stripped state events](#stripped-state) that form the invite - state. + description: |- + The [stripped state events](/client-server-api/#stripped-state) that form the + invite state. items: $ref: ../../event-schemas/schema/core-event-schema/stripped_state.yaml type: array @@ -325,12 +326,14 @@ paths: knock_state: title: KnockState type: object - description: The [stripped state](#stripped-state) of a room that the user has + description: |- + The [stripped state](/client-server-api/#stripped-state) of a room that the user has knocked upon. properties: events: - description: The [stripped state events](#stripped-state) that form the knock - state. + description: |- + The [stripped state events](/client-server-api/#stripped-state) that form the + knock state. items: $ref: ../../event-schemas/schema/core-event-schema/stripped_state.yaml type: array diff --git a/data/api/client-server/whoami.yaml b/data/api/client-server/whoami.yaml index 390fa773b..8f4027e73 100644 --- a/data/api/client-server/whoami.yaml +++ b/data/api/client-server/whoami.yaml @@ -57,9 +57,9 @@ paths: x-addedInMatrixVersion: "1.2" type: boolean description: |- - When `true`, the user is a [Guest User](#guest-access). When - not present or `false`, the user is presumed to be a non-guest - user. + When `true`, the user is a [Guest User](/client-server-api/#guest-access). + When not present or `false`, the user is presumed to be a + non-guest user. examples: response: value: { diff --git a/data/api/server-server/events.yaml b/data/api/server-server/events.yaml index 30e228301..f61f6fe41 100644 --- a/data/api/server-server/events.yaml +++ b/data/api/server-server/events.yaml @@ -216,8 +216,8 @@ paths: using the `origin_server_ts` property, whether the returned event is closer to the requested timestamp than the closest event that it could find locally. If so, it should try to backfill this event via the - [`/event/{event_id}`](#get_matrixfederationv1eventeventid) endpoint so - that it is available to for a client to query. + [`/event/{event_id}`](/server-server-api/#get_matrixfederationv1eventeventid) + endpoint so that it is available to for a client to query. operationId: getEventByTimestamp security: - accessToken: [] diff --git a/data/api/server-server/joins-v1.yaml b/data/api/server-server/joins-v1.yaml index a361836c6..9247626a3 100644 --- a/data/api/server-server/joins-v1.yaml +++ b/data/api/server-server/joins-v1.yaml @@ -155,7 +155,7 @@ paths: The request is invalid, the room the server is attempting to join has a version that is not listed in the `ver` parameters, or the server was unable to validate - [restricted room conditions](#restricted-rooms). + [restricted room conditions](/server-server-api/#restricted-rooms). The error should be passed through to clients so that they may give better feedback to users. diff --git a/data/api/server-server/space_hierarchy.yaml b/data/api/server-server/space_hierarchy.yaml index 1b9ba99c5..8394588ba 100644 --- a/data/api/server-server/space_hierarchy.yaml +++ b/data/api/server-server/space_hierarchy.yaml @@ -75,7 +75,7 @@ paths: items: type: string description: |- - If the room is a [restricted room](#restricted-rooms), these are the room IDs which + If the room is a [restricted room](/server-server-api/#restricted-rooms), these are the room IDs which are specified by the join rules. Empty or omitted otherwise. children_state: type: array @@ -119,7 +119,7 @@ paths: items: type: string description: |- - If the room is a [restricted room](#restricted-rooms), these are the room IDs which + If the room is a [restricted room](/server-server-api/#restricted-rooms), these are the room IDs which are specified by the join rules. Empty or omitted otherwise. inaccessible_children: type: array diff --git a/data/event-schemas/schema/m.forwarded_room_key.yaml b/data/event-schemas/schema/m.forwarded_room_key.yaml index 10b8b6525..101716a0e 100644 --- a/data/event-schemas/schema/m.forwarded_room_key.yaml +++ b/data/event-schemas/schema/m.forwarded_room_key.yaml @@ -4,7 +4,7 @@ allOf: description: |- This event type is used to forward keys for end-to-end encryption. - It is encrypted as an `m.room.encrypted` event using [Olm](#molmv1curve25519-aes-sha2), + It is encrypted as an `m.room.encrypted` event using [Olm](/client-server-api/#molmv1curve25519-aes-sha2), then sent as a [to-device](/client-server-api/#send-to-device-messaging) event. properties: content: diff --git a/data/event-schemas/schema/m.key.verification.request.yaml b/data/event-schemas/schema/m.key.verification.request.yaml index 76ba618d4..880d49004 100644 --- a/data/event-schemas/schema/m.key.verification.request.yaml +++ b/data/event-schemas/schema/m.key.verification.request.yaml @@ -5,7 +5,8 @@ allOf: description: |- Requests a key verification using to-device messaging. When requesting a key verification in a room, a `m.room.message` should be used, with - [`m.key.verification.request`](#mroommessagemkeyverificationrequest) as msgtype. + [`m.key.verification.request`](/client-server-api/#mroommessagemkeyverificationrequest) + as msgtype. properties: content: properties: diff --git a/data/event-schemas/schema/m.room.create.yaml b/data/event-schemas/schema/m.room.create.yaml index 1ca37865c..19b2bae4e 100644 --- a/data/event-schemas/schema/m.room.create.yaml +++ b/data/event-schemas/schema/m.room.create.yaml @@ -18,7 +18,8 @@ properties: type: string type: description: |- - Optional [room type](#types) to denote a room's intended function outside of traditional conversation. + Optional [room type](/client-server-api/#types) to denote a room's intended function outside of traditional + conversation. Unspecified room types are possible using [Namespaced Identifiers](/appendices/#common-namespaced-identifier-grammar). type: string diff --git a/data/event-schemas/schema/m.room.encrypted.yaml b/data/event-schemas/schema/m.room.encrypted.yaml index f608a6e2a..6a5689ac8 100644 --- a/data/event-schemas/schema/m.room.encrypted.yaml +++ b/data/event-schemas/schema/m.room.encrypted.yaml @@ -46,14 +46,15 @@ properties: "1.3": |- Previously this field was required, however given it offers no additional security or privacy benefit it has been deprecated for Megolm messages. - See [`m.megolm.v1.aes-sha2`](#mmegolmv1aes-sha2) for more information. + See [`m.megolm.v1.aes-sha2`](/client-server-api/#mmegolmv1aes-sha2) for + more information. description: |- The Curve25519 key of the sender. Required (not deprecated) if not using Megolm. **Deprecated**: This field provides no additional security or privacy benefit for Megolm messages and must not be read from if the encrypted event is using Megolm. It should still be included on outgoing messages, however must not be - used to find the corresponding session. See [`m.megolm.v1.aes-sha2`](#mmegolmv1aes-sha2) + used to find the corresponding session. See [`m.megolm.v1.aes-sha2`](/client-server-api/#mmegolmv1aes-sha2) for more information. device_id: type: string @@ -62,15 +63,15 @@ properties: "1.3": |- Previously this field was required for Megolm messages, however given it offers no additional security or privacy benefit it has been deprecated - for Megolm messages. See [`m.megolm.v1.aes-sha2`](#mmegolmv1aes-sha2) for - more information. + for Megolm messages. See [`m.megolm.v1.aes-sha2`](/client-server-api/#mmegolmv1aes-sha2) + for more information. description: |- The ID of the sending device. **Deprecated**: This field provides no additional security or privacy benefit for Megolm messages and must not be read from if the encrypted event is using Megolm. It should still be included on outgoing messages, however must not be - used to find the corresponding session. See [`m.megolm.v1.aes-sha2`](#mmegolmv1aes-sha2) + used to find the corresponding session. See [`m.megolm.v1.aes-sha2`](/client-server-api/#mmegolmv1aes-sha2) for more information. session_id: type: string diff --git a/data/event-schemas/schema/m.room.member.yaml b/data/event-schemas/schema/m.room.member.yaml index f2d297b5a..8d2126874 100644 --- a/data/event-schemas/schema/m.room.member.yaml +++ b/data/event-schemas/schema/m.room.member.yaml @@ -64,7 +64,7 @@ properties: type: string description: |- Usually found on `join` events, this field is used to denote which homeserver (through representation of a user with sufficient power level) - authorised the user's join. More information about this field can be found in the [Restricted Rooms Specification](#restricted-rooms). + authorised the user's join. More information about this field can be found in the [Restricted Rooms Specification](/client-server-api/#restricted-rooms). Client and server implementations should be aware of the [signing implications](/rooms/v8/#authorization-rules) of including this field in further events: in particular, the event must be signed by the server which diff --git a/data/event-schemas/schema/m.room.message$m.key.verification.request.yaml b/data/event-schemas/schema/m.room.message$m.key.verification.request.yaml index c0a0764c5..43882ab9c 100644 --- a/data/event-schemas/schema/m.room.message$m.key.verification.request.yaml +++ b/data/event-schemas/schema/m.room.message$m.key.verification.request.yaml @@ -3,7 +3,7 @@ allOf: - $ref: core-event-schema/room_event.yaml description: Requests a key verification in a room. When requesting a key verification - using to-device messaging, an event with type [`m.key.verification.request`](#mkeyverificationrequest) + using to-device messaging, an event with type [`m.key.verification.request`](/client-server-api/#mkeyverificationrequest) should be used. properties: content: diff --git a/data/event-schemas/schema/m.room_key.yaml b/data/event-schemas/schema/m.room_key.yaml index 34ceb9ae8..c90b41b4c 100644 --- a/data/event-schemas/schema/m.room_key.yaml +++ b/data/event-schemas/schema/m.room_key.yaml @@ -4,7 +4,7 @@ allOf: description: |- This event type is used to exchange keys for end-to-end encryption. - It is encrypted as an `m.room.encrypted` event using [Olm](#molmv1curve25519-aes-sha2), + It is encrypted as an `m.room.encrypted` event using [Olm](/client-server-api/#molmv1curve25519-aes-sha2), then sent as a [to-device](/client-server-api/#send-to-device-messaging) event. properties: content: diff --git a/data/event-schemas/schema/m.room_key_request.yaml b/data/event-schemas/schema/m.room_key_request.yaml index 9894456e2..62b07a23a 100644 --- a/data/event-schemas/schema/m.room_key_request.yaml +++ b/data/event-schemas/schema/m.room_key_request.yaml @@ -26,7 +26,7 @@ properties: x-changedInMatrixVersion: "1.3": |- Previously this field was required, however given it offers no additional - security or privacy benefit it has been deprecated. See [`m.megolm.v1.aes-sha2`](#mmegolmv1aes-sha2) + security or privacy benefit it has been deprecated. See [`m.megolm.v1.aes-sha2`](/client-server-api/#mmegolmv1aes-sha2) for more information. description: |- The Curve25519 key of the device which initiated the session originally. @@ -34,7 +34,7 @@ properties: **Deprecated**: This field provides no additional security or privacy benefit and must not be read from. It should still be included on outgoing messages (if the event for which keys are being requested for *also* has a `sender_key`), - however must not be used to find the corresponding session. See [`m.megolm.v1.aes-sha2`](#mmegolmv1aes-sha2) + however must not be used to find the corresponding session. See [`m.megolm.v1.aes-sha2`](/client-server-api/#mmegolmv1aes-sha2) for more information. session_id: type: string diff --git a/data/event-schemas/schema/m.secret.send.yaml b/data/event-schemas/schema/m.secret.send.yaml index ecf22183c..a2cafb6d9 100644 --- a/data/event-schemas/schema/m.secret.send.yaml +++ b/data/event-schemas/schema/m.secret.send.yaml @@ -4,7 +4,8 @@ allOf: description: |- Sent by a client to share a secret with another device, in response to an `m.secret.request` event. It must be encrypted as an `m.room.encrypted` event - using [Olm](#molmv1curve25519-aes-sha2), then sent as a to-device event. + using [Olm](/client-server-api/#molmv1curve25519-aes-sha2), then sent as a + to-device event. The `request_id` must match the ID previously given in an `m.secret.request` event. The recipient must ensure that this event comes from a device that the diff --git a/data/event-schemas/schema/m.space.child.yaml b/data/event-schemas/schema/m.space.child.yaml index c73d440fa..2222b3a1a 100644 --- a/data/event-schemas/schema/m.space.child.yaml +++ b/data/event-schemas/schema/m.space.child.yaml @@ -1,7 +1,7 @@ --- allOf: - $ref: core-event-schema/state_event.yaml -description: Defines the relationship of a child room to a space-room. Has no effect in rooms which are not [spaces](#spaces). +description: Defines the relationship of a child room to a space-room. Has no effect in rooms which are not [spaces](/client-server-api/#spaces). properties: content: properties: From e9914bf9bb58c428bff1d3ddd62c6e66c64dc1b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Wed, 13 Nov 2024 18:39:36 +0100 Subject: [PATCH 10/10] Move most assets from `/static` to `/assets` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allows to only serve the file that we actually use. Signed-off-by: Kévin Commaille --- {static => assets}/css/fonts/Inter.css | 0 {static => assets}/css/fonts/README.md | 2 +- .../css/fonts/download_google_fonts_css.py | 0 {static => assets}/css/fonts/requirements.txt | 0 {static => assets}/diagrams/README.md | 0 {static => assets}/diagrams/membership.drawio | 0 {static => assets}/diagrams/membership.png | Bin .../diagrams/threaded-dag-threads.drawio | 0 .../diagrams/threaded-dag-threads.png | Bin {static => assets}/diagrams/threaded-dag.drawio | 0 {static => assets}/diagrams/threaded-dag.png | Bin {static => assets}/js/toc.js | 0 config.toml | 9 --------- layouts/partials/hooks/body-end.html | 4 ++-- layouts/partials/hooks/head-end.html | 5 +++-- 15 files changed, 6 insertions(+), 14 deletions(-) rename {static => assets}/css/fonts/Inter.css (100%) rename {static => assets}/css/fonts/README.md (97%) rename {static => assets}/css/fonts/download_google_fonts_css.py (100%) rename {static => assets}/css/fonts/requirements.txt (100%) rename {static => assets}/diagrams/README.md (100%) rename {static => assets}/diagrams/membership.drawio (100%) rename {static => assets}/diagrams/membership.png (100%) rename {static => assets}/diagrams/threaded-dag-threads.drawio (100%) rename {static => assets}/diagrams/threaded-dag-threads.png (100%) rename {static => assets}/diagrams/threaded-dag.drawio (100%) rename {static => assets}/diagrams/threaded-dag.png (100%) rename {static => assets}/js/toc.js (100%) diff --git a/static/css/fonts/Inter.css b/assets/css/fonts/Inter.css similarity index 100% rename from static/css/fonts/Inter.css rename to assets/css/fonts/Inter.css diff --git a/static/css/fonts/README.md b/assets/css/fonts/README.md similarity index 97% rename from static/css/fonts/README.md rename to assets/css/fonts/README.md index aca333042..8c939e26b 100644 --- a/static/css/fonts/README.md +++ b/assets/css/fonts/README.md @@ -16,7 +16,7 @@ load them. Example call: ```sh python3 download_google_fonts_css.py \ "https://fonts.googleapis.com/css?family=Inter:300,300i,400,400i,700,700i" \ - ../../fonts \ + ../../../static/fonts \ ../../fonts ``` diff --git a/static/css/fonts/download_google_fonts_css.py b/assets/css/fonts/download_google_fonts_css.py similarity index 100% rename from static/css/fonts/download_google_fonts_css.py rename to assets/css/fonts/download_google_fonts_css.py diff --git a/static/css/fonts/requirements.txt b/assets/css/fonts/requirements.txt similarity index 100% rename from static/css/fonts/requirements.txt rename to assets/css/fonts/requirements.txt diff --git a/static/diagrams/README.md b/assets/diagrams/README.md similarity index 100% rename from static/diagrams/README.md rename to assets/diagrams/README.md diff --git a/static/diagrams/membership.drawio b/assets/diagrams/membership.drawio similarity index 100% rename from static/diagrams/membership.drawio rename to assets/diagrams/membership.drawio diff --git a/static/diagrams/membership.png b/assets/diagrams/membership.png similarity index 100% rename from static/diagrams/membership.png rename to assets/diagrams/membership.png diff --git a/static/diagrams/threaded-dag-threads.drawio b/assets/diagrams/threaded-dag-threads.drawio similarity index 100% rename from static/diagrams/threaded-dag-threads.drawio rename to assets/diagrams/threaded-dag-threads.drawio diff --git a/static/diagrams/threaded-dag-threads.png b/assets/diagrams/threaded-dag-threads.png similarity index 100% rename from static/diagrams/threaded-dag-threads.png rename to assets/diagrams/threaded-dag-threads.png diff --git a/static/diagrams/threaded-dag.drawio b/assets/diagrams/threaded-dag.drawio similarity index 100% rename from static/diagrams/threaded-dag.drawio rename to assets/diagrams/threaded-dag.drawio diff --git a/static/diagrams/threaded-dag.png b/assets/diagrams/threaded-dag.png similarity index 100% rename from static/diagrams/threaded-dag.png rename to assets/diagrams/threaded-dag.png diff --git a/static/js/toc.js b/assets/js/toc.js similarity index 100% rename from static/js/toc.js rename to assets/js/toc.js diff --git a/config.toml b/config.toml index 581214b20..2494ad1e9 100644 --- a/config.toml +++ b/config.toml @@ -134,15 +134,6 @@ sidebar_menu_compact = true [[module.imports]] path = "github.com/matrix-org/docsy" disable = false - # Mounting /assets and /static as assets directories helps Hugo to generate - # the correct URL. - [[module.mounts]] - source = 'assets' - target = 'assets' - [[module.mounts]] - source = 'static' - target = 'assets' - # custom output formats diff --git a/layouts/partials/hooks/body-end.html b/layouts/partials/hooks/body-end.html index 377470d91..5848b74f4 100644 --- a/layouts/partials/hooks/body-end.html +++ b/layouts/partials/hooks/body-end.html @@ -13,5 +13,5 @@ in the document. */}} - - +{{ $toc := resources.Get "js/toc.js" -}} + diff --git a/layouts/partials/hooks/head-end.html b/layouts/partials/hooks/head-end.html index c01536699..2284701bf 100644 --- a/layouts/partials/hooks/head-end.html +++ b/layouts/partials/hooks/head-end.html @@ -13,5 +13,6 @@ Google Fonts manually via a script: https://github.com/matrix-org/matrix-spec/tree/main/static/css/fonts */}} - - +{{ $inter := resources.Get "css/fonts/Inter.css" -}} + +