diff --git a/config.toml b/config.toml index 1e4cb70e..c18c024e 100644 --- a/config.toml +++ b/config.toml @@ -43,7 +43,13 @@ privacy_policy = "https://matrix.org/legal/privacy-notice" # must be one of "unstable", "current", "historical" # this is used to decide whether to show a banner pointing to the current release 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/" +# 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 [params.ui] diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html index 8a736440..e78ee9c4 100644 --- a/layouts/partials/navbar.html +++ b/layouts/partials/navbar.html @@ -45,8 +45,10 @@ {{ $status := .Site.Params.version.status }} {{ if ne $status "unstable"}} - {{ $ret = .Site.Params.version.number }} - {{ $ret = delimit (slice "version" $ret) " " }} + {{ $path := path.Join "changelogs" }} + + {{/* produces a string similar to "version v1.5" */}} + {{ $ret = delimit (slice "version v" .Site.Params.version.major "." .Site.Params.version.minor) "" }} {{ end }} {{ return $ret }} diff --git a/layouts/shortcodes/changelog/changelog-changes.html b/layouts/shortcodes/changelog/changelog-changes.html index a1e27728..11a59858 100644 --- a/layouts/shortcodes/changelog/changelog-changes.html +++ b/layouts/shortcodes/changelog/changelog-changes.html @@ -7,22 +7,26 @@ it expects to find newsfragments describing changes to that API. 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. + "unstable", then it also expects to find additional settings under + `version` in config.toml: + - `major`: the major version number of the release + - `minor`: the minor version number of the release + - `release_date`: the date of the release + + The release tag is calculated as `v.`; for example `v1.5`. + + It then renders this into a table displayed before the list of changes. */}} {{ $path := path.Join "changelogs" }} {{ $status := .Site.Params.version.status }} +{{ $release_tag := delimit (slice "v" .Site.Params.version.major "." .Site.Params.version.minor) "" }} {{ 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 }}
Git commithttps://github.com/matrix-org/matrix-doc/tree/{{ $release_tag }}
Release date{{ .Site.Params.version.release_date }}
{{ end }} diff --git a/layouts/shortcodes/changelog/changelog-description.html b/layouts/shortcodes/changelog/changelog-description.html index 738ff675..3c719725 100644 --- a/layouts/shortcodes/changelog/changelog-description.html +++ b/layouts/shortcodes/changelog/changelog-description.html @@ -8,8 +8,12 @@ {{ $status := .Site.Params.version.status }} {{ if eq $status "unstable"}} +

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.number }} of the Matrix specification.

+ +

This is version v{{ .Site.Params.version.major }}.{{ .Site.Params.version.minor }} of the Matrix specification.

+ {{ end }}