diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html index 748d53c1..8a736440 100644 --- a/layouts/partials/navbar.html +++ b/layouts/partials/navbar.html @@ -45,8 +45,7 @@ {{ $status := .Site.Params.version.status }} {{ if ne $status "unstable"}} - {{ $version_pieces := slice .Site.Params.version.major_version .Site.Params.version.minor_version .Site.Params.version.patch_version}} - {{ $ret = delimit $version_pieces "." }} + {{ $ret = .Site.Params.version.number }} {{ $ret = delimit (slice "version" $ret) " " }} {{ end }} diff --git a/layouts/shortcodes/changelog/changelog-changes.html b/layouts/shortcodes/changelog/changelog-changes.html index e911b1a0..a1e27728 100644 --- a/layouts/shortcodes/changelog/changelog-changes.html +++ b/layouts/shortcodes/changelog/changelog-changes.html @@ -2,61 +2,36 @@ This template is used to render the set of changes in the changelog page. - If this version of the spec is unstable, it expects to find a - "changelogs//newsfragments" directory containing all unreleased changes, - and renders them all. + It expects to find a directory "changelogs" containing a subdirectory for + each of the 5 APIs in the specification. Inside each of these directories + it expects to find newsfragments describing changes to that API. - Otherwise it expects to find a "changelog/releases" directory, under which - is one or more directories whose name is a patch number, like "0", "1", and so on. - - It renders each of these subdirectories as a separate patch, including - a table containing basic info about that patch and the set of changes in it. + If the `version.status` setting in config.toml is anything other than + "unstable", then it also expects to find a "release.yaml" file in /changelogs, + which contains: + - `tag`: Git tag for this release + - `date`: date of this release + It then renders this info a table, before the list of changes. */}} {{ $path := path.Join "changelogs" }} - {{ $status := .Site.Params.version.status }} -{{ if eq $status "unstable" }} -

Changes since last release

- {{ partial "render-api-changes" (dict "title" "Client-Server API" "id" "client-server-api" "path" (path.Join $path "client_server")) }} - {{ partial "render-api-changes" (dict "title" "Server-Server API" "id" "server-server-api" "path" (path.Join $path "server_server")) }} - {{ partial "render-api-changes" (dict "title" "Application Service API" "id" "application-service-api" "path" (path.Join $path "application_service")) }} - {{ partial "render-api-changes" (dict "title" "Identity Service API" "id" "identity-service-api" "path" (path.Join $path "identity_service")) }} - {{ partial "render-api-changes" (dict "title" "Push Gateway API" "id" "push-gateway-api" "path" (path.Join $path "push_gateway")) }} -{{ else }} - {{ $releases_path := path.Join $path "releases" }} - {{ $major_version := .Site.Params.version.major_version }} - {{ $minor_version := .Site.Params.version.minor_version }} - {{ $releases := partial "reverse-slice" (readDir $releases_path) }} - {{ range $releases }} - {{ if .IsDir }} -

Version {{ $major_version }}.{{ $minor_version }}.{{ .Name }}

- {{ $release_path := path.Join $releases_path .Name}} - {{ $release_info := readFile (path.Join $release_path "release.yaml") | transform.Unmarshal }} +{{ if ne $status "unstable" }} +{{ $release_info := readFile (path.Join $path "release.yaml") | transform.Unmarshal }}
Git commithttps://github.com/matrix-org/matrix-doc/tree/{{ $release_info.tag }}
Release date{{ $release_info.date }}
- {{ partial "render-api-changes" (dict "title" "Client-Server API" "id" "client-server-api" "path" (path.Join $release_path "client_server")) }} - {{ partial "render-api-changes" (dict "title" "Server-Server API" "id" "server-server-api" "path" (path.Join $release_path "server_server")) }} - {{ partial "render-api-changes" (dict "title" "Application Service API" "id" "application-service-api" "path" (path.Join $release_path "application_service")) }} - {{ partial "render-api-changes" (dict "title" "Identity Service API" "id" "identity-service-api" "path" (path.Join $release_path "identity_service")) }} - {{ partial "render-api-changes" (dict "title" "Push Gateway API" "id" "push-gateway-api" "path" (path.Join $release_path "push_gateway")) }} - {{ end }} - {{ end }} {{ end }} -{{ define "partials/reverse-slice" }} -{{ $sliceOriginal := . }} -{{ $len := len $sliceOriginal }} -{{ $sliceReversed := slice }} -{{ range seq $len }} - {{ $sliceReversed = $sliceReversed | append (index $sliceOriginal (sub $len .)) }} -{{ end }} -{{ return $sliceReversed }} -{{ end }} +

Changes since last release

+{{ partial "render-api-changes" (dict "title" "Client-Server API" "id" "client-server-api" "path" (path.Join $path "client_server")) }} +{{ partial "render-api-changes" (dict "title" "Server-Server API" "id" "server-server-api" "path" (path.Join $path "server_server")) }} +{{ partial "render-api-changes" (dict "title" "Application Service API" "id" "application-service-api" "path" (path.Join $path "application_service")) }} +{{ partial "render-api-changes" (dict "title" "Identity Service API" "id" "identity-service-api" "path" (path.Join $path "identity_service")) }} +{{ partial "render-api-changes" (dict "title" "Push Gateway API" "id" "push-gateway-api" "path" (path.Join $path "push_gateway")) }} {{ define "partials/render-api-changes" }}

{{ .title }}

diff --git a/layouts/shortcodes/changelog/changelog-description.html b/layouts/shortcodes/changelog/changelog-description.html index 0c5c5c50..738ff675 100644 --- a/layouts/shortcodes/changelog/changelog-description.html +++ b/layouts/shortcodes/changelog/changelog-description.html @@ -11,14 +11,5 @@

This is the unstable version of the Matrix specification.

This changelog lists changes made since the last release of the specification.

{{ else }} -

This is version {{ .Site.Params.version.major_version}}.{{ .Site.Params.version.minor_version}}.{{ .Site.Params.version.patch_version}} of the Matrix specification.

- - -

Versions for the Matrix specification follow a three-part format like `major.minor.patch`.

- -* `major` version increments are reserved for very significant changes. -* `minor` version increments may signal additions, deprecations, or breaking changes. -* `patch` version increments are for clarifications to the specification and don't affect implementations. - -

This changelog lists changes made in the initial {{ .Site.Params.version.major_version}}.{{ .Site.Params.version.minor_version}} release and any subsequent patch releases to that version.

+

This is version {{ .Site.Params.version.number }} of the Matrix specification.

{{ end }}