{{- /* 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. 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: * 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 it is the unstable changelog. * The date of the release, taken from the `date` in the frontmatter of the page, unless it is the unstable changelog. * A link to the markdown checklist format of the changelog. The `outputs` in the frontmatter of the page must include `checklist`. */ -}} {{ define "main" }} {{ if .IsSection -}} {{ with index .RegularPages.ByDate.Reverse 0 -}} {{ end -}} {{ else -}} {{ $version := lower .LinkTitle -}}

# {{ .Title }}

{{ $rev := $version }} {{ if eq $version "unstable" -}} {{- /* Extract the git SHA from the frontmatter of the changelog, where it was stashed by `generate-changelog.sh`. */ -}} {{ $rev = .Params.commit -}} {{ end -}} {{ $commitLink := printf "https://github.com/matrix-org/matrix-spec/tree/%s" $rev -}}
Git commit | {{ $commitLink }} {{ if ne $version "unstable" }}
Release date | {{ .Date | time.Format ":date_long" }} {{ end -}} {{ $checklist := .OutputFormats.Get "checklist" -}}
Checklist | checklist.md

{{ .Content }}
{{ end -}} {{ end }}