Undo support for patch versions; use an opaque version string

pull/977/head
Will 3 years ago
parent 108b323e10
commit ee87cf2b63
No known key found for this signature in database
GPG Key ID: 385872BB265E8BF8

@ -45,8 +45,7 @@
{{ $status := .Site.Params.version.status }} {{ $status := .Site.Params.version.status }}
{{ if ne $status "unstable"}} {{ if ne $status "unstable"}}
{{ $version_pieces := slice .Site.Params.version.major_version .Site.Params.version.minor_version .Site.Params.version.patch_version}} {{ $ret = .Site.Params.version.number }}
{{ $ret = delimit $version_pieces "." }}
{{ $ret = delimit (slice "version" $ret) " " }} {{ $ret = delimit (slice "version" $ret) " " }}
{{ end }} {{ end }}

@ -2,61 +2,36 @@
This template is used to render the set of changes in the changelog page. 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 It expects to find a directory "changelogs" containing a subdirectory for
"changelogs/<api>/newsfragments" directory containing all unreleased changes, each of the 5 APIs in the specification. Inside each of these directories
and renders them all. it expects to find newsfragments describing changes to that API.
Otherwise it expects to find a "changelog/releases" directory, under which If the `version.status` setting in config.toml is anything other than
is one or more directories whose name is a patch number, like "0", "1", and so on. "unstable", then it also expects to find a "release.yaml" file in /changelogs,
which contains:
It renders each of these subdirectories as a separate patch, including - `tag`: Git tag for this release
a table containing basic info about that patch and the set of changes in it. - `date`: date of this release
It then renders this info a table, before the list of changes.
*/}} */}}
{{ $path := path.Join "changelogs" }} {{ $path := path.Join "changelogs" }}
{{ $status := .Site.Params.version.status }} {{ $status := .Site.Params.version.status }}
{{ if eq $status "unstable" }} {{ if ne $status "unstable" }}
<h2 id=api-changes>Changes since last release</h2> {{ $release_info := readFile (path.Join $path "release.yaml") | transform.Unmarshal }}
{{ 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 }}
<h2 id="{{ .Name }}">Version {{ $major_version }}.{{ $minor_version }}.{{ .Name }}</h2>
{{ $release_path := path.Join $releases_path .Name}}
{{ $release_info := readFile (path.Join $release_path "release.yaml") | transform.Unmarshal }}
<table class="release-info"> <table class="release-info">
<tr><th>Git commit</th><td><a href="https://github.com/matrix-org/matrix-doc/tree/{{ $release_info.tag }}">https://github.com/matrix-org/matrix-doc/tree/{{ $release_info.tag }}</a></td> <tr><th>Git commit</th><td><a href="https://github.com/matrix-org/matrix-doc/tree/{{ $release_info.tag }}">https://github.com/matrix-org/matrix-doc/tree/{{ $release_info.tag }}</a></td>
<tr><th>Release date</th><td>{{ $release_info.date }}</td> <tr><th>Release date</th><td>{{ $release_info.date }}</td>
</table> </table>
{{ 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 }} {{ end }}
{{ define "partials/reverse-slice" }} <h2 id=api-changes>Changes since last release</h2>
{{ $sliceOriginal := . }} {{ partial "render-api-changes" (dict "title" "Client-Server API" "id" "client-server-api" "path" (path.Join $path "client_server")) }}
{{ $len := len $sliceOriginal }} {{ partial "render-api-changes" (dict "title" "Server-Server API" "id" "server-server-api" "path" (path.Join $path "server_server")) }}
{{ $sliceReversed := slice }} {{ partial "render-api-changes" (dict "title" "Application Service API" "id" "application-service-api" "path" (path.Join $path "application_service")) }}
{{ range seq $len }} {{ partial "render-api-changes" (dict "title" "Identity Service API" "id" "identity-service-api" "path" (path.Join $path "identity_service")) }}
{{ $sliceReversed = $sliceReversed | append (index $sliceOriginal (sub $len .)) }} {{ partial "render-api-changes" (dict "title" "Push Gateway API" "id" "push-gateway-api" "path" (path.Join $path "push_gateway")) }}
{{ end }}
{{ return $sliceReversed }}
{{ end }}
{{ define "partials/render-api-changes" }} {{ define "partials/render-api-changes" }}
<h3 id="{{.id}}">{{ .title }}</h3> <h3 id="{{.id}}">{{ .title }}</h3>

@ -11,14 +11,5 @@
<p>This is the <strong>unstable</strong> version of the Matrix specification.</p> <p>This is the <strong>unstable</strong> version of the Matrix specification.</p>
<p>This changelog lists changes made since the last release of the specification.</p> <p>This changelog lists changes made since the last release of the specification.</p>
{{ else }} {{ else }}
<p>This is version <strong>{{ .Site.Params.version.major_version}}.{{ .Site.Params.version.minor_version}}.{{ .Site.Params.version.patch_version}}</strong> of the Matrix specification.</p> <p>This is version <strong>{{ .Site.Params.version.number }}</strong> of the Matrix specification.</p>
<p>Versions for the Matrix specification follow a three-part format like `major.minor.patch`.</p>
* `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.
<p>This changelog lists changes made in the initial <strong>{{ .Site.Params.version.major_version}}.{{ .Site.Params.version.minor_version}}</strong> release and any subsequent patch releases to that version.</p>
{{ end }} {{ end }}

Loading…
Cancel
Save