mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-03-14 07:24:11 +01:00
Add link to git commit for unstable version too
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
This commit is contained in:
parent
cb83c5a76e
commit
149a0e984f
1
changelogs/internal/newsfragments/2078.clarification
Normal file
1
changelogs/internal/newsfragments/2078.clarification
Normal file
|
|
@ -0,0 +1 @@
|
|||
Add link to the git commit for the unstable changelog.
|
||||
|
|
@ -31,9 +31,13 @@
|
|||
<h1>{{ .Title }}</h1>
|
||||
|
||||
<table class="release-info">
|
||||
{{ if ne $version "unstable" -}}
|
||||
{{ $commitLink := printf "https://github.com/matrix-org/matrix-spec/tree/%s" $version -}}
|
||||
{{ $rev := $version }}
|
||||
{{ if eq $version "unstable" -}}
|
||||
{{ $rev = .Params.commit -}}
|
||||
{{ end -}}
|
||||
{{ $commitLink := printf "https://github.com/matrix-org/matrix-spec/tree/%s" $rev -}}
|
||||
<tr><th>Git commit</th><td><a href="{{ $commitLink }}">{{ $commitLink }}</a></td>
|
||||
{{ if ne $version "unstable" }}
|
||||
<tr><th>Release date</th><td>{{ .Date | time.Format ":date_long" }}</td>
|
||||
{{ end -}}
|
||||
{{ $checklist := .OutputFormats.Get "checklist" -}}
|
||||
|
|
|
|||
|
|
@ -44,8 +44,18 @@ outputs:
|
|||
- html
|
||||
- checklist
|
||||
date: $(date -Idate)
|
||||
---
|
||||
EOF
|
||||
|
||||
# Add the commit hash for the unstable versions. It is used to generate a
|
||||
# link to the commit on the repository.
|
||||
if [ "$VERSION" == "vUNSTABLE" ]; then
|
||||
echo "params:"
|
||||
echo " commit: $(git rev-parse --short HEAD)"
|
||||
fi
|
||||
|
||||
# Close the frontmatter.
|
||||
echo "---"
|
||||
|
||||
# Remove trailing whitespace (such as our intentionally blank RST headings)
|
||||
sed -e "s/[ ]*$//" rendered.md
|
||||
} > ../content/changelog/$FILENAME
|
||||
|
|
|
|||
Loading…
Reference in a new issue