Use changelogs/release.yaml
for the version number source everywhere (#3310)
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
This commit is contained in:
parent
cf5b519963
commit
ff2c93af1c
4 changed files with 27 additions and 11 deletions
|
@ -43,7 +43,13 @@ privacy_policy = "https://matrix.org/legal/privacy-notice"
|
||||||
# must be one of "unstable", "current", "historical"
|
# must be one of "unstable", "current", "historical"
|
||||||
# this is used to decide whether to show a banner pointing to the current release
|
# this is used to decide whether to show a banner pointing to the current release
|
||||||
status = "unstable"
|
status = "unstable"
|
||||||
|
# A URL pointing to the latest, stable release of the spec. To be shown in the unstable version warning banner.
|
||||||
current_version_url = "https://matrix.org/docs/spec/"
|
current_version_url = "https://matrix.org/docs/spec/"
|
||||||
|
# The following is used when status = "stable", and is displayed in various UI elements on a released version
|
||||||
|
# of the spec. CI will set these values here automatically when a release git tag (i.e `v1.5`) is created.
|
||||||
|
#major = "1"
|
||||||
|
#minor = "0"
|
||||||
|
#release_date = "April 01, 2021"
|
||||||
|
|
||||||
# User interface configuration
|
# User interface configuration
|
||||||
[params.ui]
|
[params.ui]
|
||||||
|
|
|
@ -45,8 +45,10 @@
|
||||||
{{ $status := .Site.Params.version.status }}
|
{{ $status := .Site.Params.version.status }}
|
||||||
|
|
||||||
{{ if ne $status "unstable"}}
|
{{ if ne $status "unstable"}}
|
||||||
{{ $ret = .Site.Params.version.number }}
|
{{ $path := path.Join "changelogs" }}
|
||||||
{{ $ret = delimit (slice "version" $ret) " " }}
|
|
||||||
|
{{/* produces a string similar to "version v1.5" */}}
|
||||||
|
{{ $ret = delimit (slice "version v" .Site.Params.version.major "." .Site.Params.version.minor) "" }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ return $ret }}
|
{{ return $ret }}
|
||||||
|
|
|
@ -7,22 +7,26 @@
|
||||||
it expects to find newsfragments describing changes to that API.
|
it expects to find newsfragments describing changes to that API.
|
||||||
|
|
||||||
If the `version.status` setting in config.toml is anything other than
|
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,
|
"unstable", then it also expects to find additional settings under
|
||||||
which contains:
|
`version` in config.toml:
|
||||||
- `tag`: Git tag for this release
|
- `major`: the major version number of the release
|
||||||
- `date`: date of this release
|
- `minor`: the minor version number of the release
|
||||||
It then renders this info a table, before the list of changes.
|
- `release_date`: the date of the release
|
||||||
|
|
||||||
|
The release tag is calculated as `v<major>.<minor>`; for example `v1.5`.
|
||||||
|
|
||||||
|
It then renders this into a table displayed before the list of changes.
|
||||||
|
|
||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
{{ $path := path.Join "changelogs" }}
|
{{ $path := path.Join "changelogs" }}
|
||||||
{{ $status := .Site.Params.version.status }}
|
{{ $status := .Site.Params.version.status }}
|
||||||
|
{{ $release_tag := delimit (slice "v" .Site.Params.version.major "." .Site.Params.version.minor) "" }}
|
||||||
|
|
||||||
{{ if ne $status "unstable" }}
|
{{ if ne $status "unstable" }}
|
||||||
{{ $release_info := readFile (path.Join $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_tag }}">https://github.com/matrix-org/matrix-doc/tree/{{ $release_tag }}</a></td>
|
||||||
<tr><th>Release date</th><td>{{ $release_info.date }}</td>
|
<tr><th>Release date</th><td>{{ .Site.Params.version.release_date }}</td>
|
||||||
</table>
|
</table>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,12 @@
|
||||||
{{ $status := .Site.Params.version.status }}
|
{{ $status := .Site.Params.version.status }}
|
||||||
|
|
||||||
{{ if eq $status "unstable"}}
|
{{ if eq $status "unstable"}}
|
||||||
|
|
||||||
<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.number }}</strong> of the Matrix specification.</p>
|
|
||||||
|
<p>This is version <strong>v{{ .Site.Params.version.major }}.{{ .Site.Params.version.minor }}</strong> of the Matrix specification.</p>
|
||||||
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue