Upgrade docsy to 0.12.0 (#2160)

pull/2206/head
Kévin Commaille 3 months ago committed by GitHub
parent b5ee6adc0f
commit 4d4069166d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,7 +1,7 @@
name: "Spec"
env:
HUGO_VERSION: 0.139.0
HUGO_VERSION: 0.148.1
PYTHON_VERSION: 3.13
on:

@ -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

@ -0,0 +1 @@
Upgrade the docsy theme to version 0.12.0.

@ -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]
@ -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

@ -1,6 +1,7 @@
---
title: Changelog
type: docs
layout: changelog-index
weight: 1000
---

@ -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

@ -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=

@ -1,11 +0,0 @@
{{- /*
A simplified copy of the inlined "_default/_markup/_td-heading-self-link.html"
template in Docsy's "_default/_markup/td-render-heading.html" template to be
able to reuse it when the heading has custom markup.
Takes a string which is the ID of the heading.
*/ -}}
<a class="td-heading-self-link" href="#{{ . | safeURL }}" aria-label="Heading self-link"></a>

@ -8,4 +8,4 @@
heading.
*/ -}}
{{ template "_default/_markup/td-render-heading.html" . }}
{{ partial "td/render-heading.html" . }}

@ -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>

@ -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 }}
@ -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 }}
@ -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 }}

@ -80,7 +80,7 @@
</div>
</nav>
{{ define "partials/version-string" }}
{{ define "_partials/version-string" }}
{{ $ret := "unstable version"}}
{{ $status := .Site.Params.version.status }}

@ -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 }}
@ -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>
@ -101,8 +101,8 @@ resolve-additional-types.)
{{ $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>
@ -138,7 +138,7 @@ resolve-additional-types.)
* `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" }}
@ -215,7 +215,7 @@ resolve-additional-types.)
* `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 }}
{{/*
@ -306,7 +306,7 @@ resolve-additional-types.)
* `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 -}}
{{/*
@ -331,7 +331,7 @@ resolve-additional-types.)
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" . }}

@ -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>

@ -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>

@ -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 }}

@ -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
@ -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>
@ -50,5 +39,4 @@
{{ .Content }}
</div>
{{ end -}}
{{ end }}

Loading…
Cancel
Save