mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-03-28 05:54:09 +01:00
Use Hugo page resources instead of partials for changelogs
... which means we don't need to edit the top-level page for each release.
This commit is contained in:
parent
ac1c5ad2bb
commit
ce84f1682c
|
|
@ -8,11 +8,7 @@ weight: 1000
|
||||||
|
|
||||||
{{% changelog/changelog-changes %}}
|
{{% changelog/changelog-changes %}}
|
||||||
|
|
||||||
<!-- DO NOT REMOVE OR CHANGE - Release script puts next release here -->
|
{{% changelog/changelogs %}}
|
||||||
{{% changelog/changelog-rendered p="changelogs/v1.4.md" %}}
|
|
||||||
{{% changelog/changelog-rendered p="changelogs/v1.3.md" %}}
|
|
||||||
{{% changelog/changelog-rendered p="changelogs/v1.2.md" %}}
|
|
||||||
{{% changelog/changelog-rendered p="changelogs/v1.1.md" %}}
|
|
||||||
|
|
||||||
<h2 id="historical-versions" class="no-numbers">Historical versions</h2>
|
<h2 id="historical-versions" class="no-numbers">Historical versions</h2>
|
||||||
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
{{ $partial := .Params.p }}
|
|
||||||
{{ partial $partial . }}
|
|
||||||
10
layouts/shortcodes/changelog/changelogs.html
Normal file
10
layouts/shortcodes/changelog/changelogs.html
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
{{/*
|
||||||
|
This template is used to render all of the changelog sections under
|
||||||
|
"content/changelogs"
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
{{ with .Page.Resources.Match "*.md" }}
|
||||||
|
{{ range ((sort . "Name" "desc")) }}
|
||||||
|
{{ .Content }}
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
5
scripts/generate-changelog.sh
Normal file → Executable file
5
scripts/generate-changelog.sh
Normal file → Executable file
|
|
@ -4,8 +4,6 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
MAGIC_STRING="<!-- DO NOT REMOVE OR CHANGE - Release script puts next release here -->"
|
|
||||||
|
|
||||||
cd changelogs
|
cd changelogs
|
||||||
|
|
||||||
# Pre-cleanup just in case it wasn't done on the last run
|
# Pre-cleanup just in case it wasn't done on the last run
|
||||||
|
|
@ -31,8 +29,7 @@ cat rendered.header.md rendered.md > rendered.final.md
|
||||||
sed -i "s/[ ]*$//" rendered.final.md
|
sed -i "s/[ ]*$//" rendered.final.md
|
||||||
|
|
||||||
# Put the changelog in place
|
# Put the changelog in place
|
||||||
mv rendered.final.md ../layouts/partials/changelogs/$1.md
|
mv rendered.final.md ../content/changelogs/$1.md
|
||||||
sed -i "s/$MAGIC_STRING/$MAGIC_STRING\n{{% changelog\\/changelog-rendered p=\"changelogs\\/$1.md\" %}}/" ../content/changelog.md
|
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
rm -v rendered.*
|
rm -v rendered.*
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue