Skip to content

Upgrade docsy to 0.12.0 #2160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: "Spec"

env:
HUGO_VERSION: 0.139.0
HUGO_VERSION: 0.148.1
PYTHON_VERSION: 3.13

on:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.123.1 is required.
v0.146.0 is required.

Alternatively, use the Docker image at
https://hub.docker.com/r/klakegg/hugo/. (The "extended edition" is required
Expand Down
1 change: 1 addition & 0 deletions changelogs/internal/newsfragments/2160.clarification
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Upgrade the docsy theme to version 0.12.0.
4 changes: 2 additions & 2 deletions config/_default/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ enableRobotsTXT = true
# We disable RSS, because (a) it's useless, (b) Hugo seems to generate broken
# links to it when used with a --baseURL (for example, https://spec.matrix.org/v1.4/
# contains `<link rel="alternate" type="application/rss&#43;xml" href="/v1.4/v1.4/index.xml">`).
disableKinds = ["taxonomy", "RSS"]
disableKinds = ["taxonomy", "rss"]

[languages]
[languages.en]
Expand Down Expand Up @@ -134,7 +134,7 @@ sidebar_menu_compact = true
[module]
[module.hugoVersion]
extended = true
min = "0.123.1"
min = "0.146.0"
[[module.imports]]
path = "github.com/matrix-org/docsy"
disable = false
Expand Down
1 change: 1 addition & 0 deletions content/changelog/_index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Changelog
type: docs
layout: changelog-index
weight: 1000
---

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module github.com/matrix-org/matrix-spec

go 1.12

require github.com/matrix-org/docsy v0.0.0-20241106102557-ec7b98ee4014 // indirect
require github.com/matrix-org/docsy v0.0.0-20250722140156-5df72519f5af // indirect
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github.com/FortAwesome/Font-Awesome v0.0.0-20240716171331-37eff7fa00de/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
github.com/matrix-org/docsy v0.0.0-20241106102557-ec7b98ee4014 h1:CNvxuuURuxkEjA0QN+lRKELc7PRDsX270e8v4GDF3II=
github.com/matrix-org/docsy v0.0.0-20241106102557-ec7b98ee4014/go.mod h1:4Ek1bcdbfU/j8hIatEjNhIs1Yua85FtQf3kLvoYZ0bQ=
github.com/twbs/bootstrap v5.3.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
github.com/FortAwesome/Font-Awesome v0.0.0-20241216213156-af620534bfc3/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
github.com/matrix-org/docsy v0.0.0-20250722140156-5df72519f5af h1:XghgUC0H5BoGrvtT9/oWBUi+5Zux875qRHhpAZ0RURI=
github.com/matrix-org/docsy v0.0.0-20250722140156-5df72519f5af/go.mod h1:4/t21g/nPraob/DVMm3jrk26k0CDL5I7Mxf+ar0IAgs=
github.com/twbs/bootstrap v5.3.6+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=
11 changes: 0 additions & 11 deletions layouts/_default/_markup/td-heading-self-link.html

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
heading.

*/ -}}
{{ template "_default/_markup/td-render-heading.html" . }}
{{ partial "td/render-heading.html" . }}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

<h1 id="{{ $anchor }}">
{{ with .title }}{{ . | markdownify }}{{ else }}<code>{{ $event_name }}</code>{{ end }}
{{ template "_default/_markup/td-heading-self-link.html" $anchor }}
{{ partial "td/heading-self-link.html" (dict "Anchor" $anchor) }}
</h1>

</summary>
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
* If the input `schema` was itself an object that we should create a table for,
* this will be the same as the first entry in `objects`.
*/
{{ define "partials/resolve-additional-types-inner" }}
{{ define "_partials/resolve-additional-types-inner" }}
{{ $this_object := .schema }}
{{ $anchor_base := .anchor_base }}
{{ $name := .name }}
Expand Down Expand Up @@ -222,7 +222,7 @@
* * `objects`: The array of object schema definitions.
* * `schema`: An updated copy of the `schema` input (eg, an `anchor` may be added).
*/
{{ define "partials/get-additional-objects" }}
{{ define "_partials/get-additional-objects" }}
/* .name is the name of the object for logging purposes */
{{ $name := .name }}

Expand All @@ -246,6 +246,6 @@
* This is needed for uniqify to work - otherwise objects that are the same
* but with (for example) different examples will be considered different.
*/
{{ define "partials/clean-object" }}
{{ define "_partials/clean-object" }}
{{ return (dict "title" .title "properties" .properties "additionalProperties" .additionalProperties "patternProperties" .patternProperties "required" .required "enum" .enum "anchor" .anchor) }}
{{ end }}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
</div>
</nav>

{{ define "partials/version-string" }}
{{ define "_partials/version-string" }}
{{ $ret := "unstable version"}}

{{ $status := .Site.Params.version.status }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@

<tr>
<td><code>{{ $property_name }}</code></td>
<td><code>{{ partial "partials/property-type" $property | safeHTML }}</code></td>
<td>{{ partial "partials/property-description" (dict "property" $property "required" $required) }}</td>
<td><code>{{ partial "property-type" $property | safeHTML }}</code></td>
<td>{{ partial "property-description" (dict "property" $property "required" $required) }}</td>
</tr>

{{ end }}
Expand All @@ -71,8 +71,8 @@

<tr>
<td>&lt;Other properties&gt;</td>
<td><code>{{ partial "partials/property-type" .additionalProperties | safeHTML }}</code></td>
<td>{{ partial "partials/property-description" (dict "property" .additionalProperties) }}</td>
<td><code>{{ partial "property-type" .additionalProperties | safeHTML }}</code></td>
<td>{{ partial "property-description" (dict "property" .additionalProperties) }}</td>
</tr>
{{ end }}
</table>
Expand Down Expand Up @@ -101,8 +101,8 @@
{{ $property := . }}

<tr>
<td><code>{{ partial "partials/property-type" $property | safeHTML }}</code></td>
<td>{{ partial "partials/property-description" (dict "property" $property) }}</td>
<td><code>{{ partial "property-type" $property | safeHTML }}</code></td>
<td>{{ partial "property-description" (dict "property" $property) }}</td>
</tr>
</table>

Expand Down Expand Up @@ -138,7 +138,7 @@
* `format`: optional string for the format of the type, used for strings.

*/}}
{{ define "partials/property-type" }}
{{ define "_partials/property-type" }}
{{ $type := "" }}

{{ if eq .type "object" }}
Expand Down Expand Up @@ -215,7 +215,7 @@

* `anchor`: optional HTML element id for the target type, which will be used to link to it.
*/}}
{{ define "partials/object-type-or-title" }}
{{ define "_partials/object-type-or-title" }}
{{ $type := "object" }}
{{ if .properties }}
{{/*
Expand Down Expand Up @@ -306,7 +306,7 @@
* `x-changedInMatrixVersion`: optional string indicating in which Matrix
spec version this property was last changed.
*/}}
{{ define "partials/property-description" -}}
{{ define "_partials/property-description" -}}
{{ $description := .property.description -}}
{{ if .required -}}
{{/*
Expand All @@ -331,7 +331,7 @@
Computes the type to display for a string format, given the identifier of
the format as a string.
*/}}
{{ define "partials/string-format" }}
{{ define "_partials/string-format" }}
{{ $stringFormat := "" }}

{{ with index site.Data "string-formats" . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<h1 id="{{ $anchor }}">
<span class="http-api-method">{{ $method }}</span>
<span class="endpoint{{ if $operation_data.deprecated }} deprecated-inline{{ end }}">{{ $endpoint }}</span>
{{ template "_default/_markup/td-heading-self-link.html" $anchor }}
{{ partial "td/heading-self-link.html" (dict "Anchor" $anchor) }}
</h1>
</summary>

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 3 additions & 1 deletion layouts/docs/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
</aside>
<main class="col-12 col-md-9 col-xl-8 ps-md-5" role="main">
{{ partial "version-banner.html" . }}
{{ if not .Site.Params.ui.breadcrumb_disable }}{{ partial "breadcrumb.html" . }}{{ end }}
{{ if not (.Param "ui.breadcrumb_disable") -}}
{{ partial "breadcrumb.html" . -}}
{{ end -}}
{{ block "main" . }}{{ end }}
</main>
</div>
Expand Down
13 changes: 13 additions & 0 deletions layouts/docs/changelog-index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{- /*

Template to the `changelog` section page.

This redirects the page to the latest version's changelog page.

*/ -}}

{{ define "main" }}
{{ with index .RegularPages.ByDate.Reverse 0 -}}
<meta http-equiv="refresh" content="0; url={{ .RelPermalink }}">
{{ end -}}
{{ end }}
16 changes: 2 additions & 14 deletions layouts/docs/changelog.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
{{- /*

Template to render a page with a `changelog` layout or the `changelog`
section page. This conflation seems to be a limitation of Hugo currently, it
uses this template for both cases.
Template to render a page with a `changelog` layout.

For the `changelog` section page, this redirects the page to the latest
version's changelog page.

For a page with a `changelog` layout, this adds a table at the top of the
page with information about the release:
This adds a table at the top of the page with information about the release:

* A link to the matrix-spec repository at the time of the release, with the
version taken from the `linkTitle` in the frontmatter of the page, unless
Expand All @@ -21,11 +15,6 @@
*/ -}}

{{ define "main" }}
{{ if .IsSection -}}
{{ with index .RegularPages.ByDate.Reverse 0 -}}
<meta http-equiv="refresh" content="0; url={{ .RelPermalink }}">
{{ end -}}
{{ else -}}
{{ $version := lower .LinkTitle -}}
<div class="td-content">
<h1>{{ .Title }}</h1>
Expand All @@ -50,5 +39,4 @@ <h1>{{ .Title }}</h1>

{{ .Content }}
</div>
{{ end -}}
{{ end }}