Skip to content

Commit 4000d95

Browse files
authored
Reverse order release notes in sidebar (k3s-io#237)
Signed-off-by: Derek Nola <derek.nola@suse.com>
1 parent f44833b commit 4000d95

File tree

8 files changed

+88
-73
lines changed

8 files changed

+88
-73
lines changed

.github/workflows/release-notes.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
workflow_dispatch
44

55
env:
6-
MINORS: "v1.25 v1.26 v1.27 v1.28"
6+
MINORS: "v1.26 v1.27 v1.28 v1.29"
77
permissions:
88
contents: write
99
pull-requests: write

docs/release-notes/v1.24.X.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
hide_table_of_contents: true
3+
sidebar_position: 6
34
---
45

56
# v1.24.X

docs/release-notes/v1.25.X.md

Lines changed: 72 additions & 71 deletions
Large diffs are not rendered by default.

docs/release-notes/v1.26.X.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
hide_table_of_contents: true
3+
sidebar_position: 4
34
---
45

56
# v1.26.X

docs/release-notes/v1.27.X.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
hide_table_of_contents: true
3+
sidebar_position: 3
34
---
45

56
# v1.27.X

docs/release-notes/v1.28.X.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
hide_table_of_contents: true
3+
sidebar_position: 2
34
---
45

56
# v1.28.X

docs/release-notes/v1.29.X.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
hide_table_of_contents: true
3+
sidebar_position: 1
34
---
45

56
# v1.29.X

scripts/collect-all-release-notes.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ for minor in $MINORS; do
2020
body=$(gh release view "${patch}" -R "k3s-io/${product}" --json body -q '.body')
2121
# Extract from each release notes the component table, building a single table with all the components
2222
if [ -z "${previous}" ]; then
23-
title="---\nhide_table_of_contents: true\n---\n\n# ${minor}.X\n"
23+
title="---\nhide_table_of_contents: true\nsidebar_position: 0\n---\n\n# ${minor}.X\n"
2424
echo -e "${title}" >> $k3s_table
2525
upgrade_link="[Urgent Upgrade Notes](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-${minor:1}.md#urgent-upgrade-notes)"
2626
upgrade_warning=":::warning Upgrade Notice\nBefore upgrading from earlier releases, be sure to read the Kubernetes ${upgrade_link}.\n:::\n"
@@ -52,3 +52,12 @@ for minor in $MINORS; do
5252
cat $k3s_table "${file}" > $k3stmp && mv $k3stmp "${file}"
5353
echo "Collected release notes for ${product} ${minor}"
5454
done
55+
56+
# For all the releases, order the release notes in reverse numerical order
57+
ITER=1
58+
echo "Reordering release notes in sidebar"
59+
for file in $(ls -r docs/release-notes/v1.*.X.md); do
60+
# Add sidebar_position: $ITER to each release notes
61+
sed -i "s/^sidebar_position:.*/sidebar_position: $ITER/" "${file}"
62+
ITER=$((ITER+1))
63+
done

0 commit comments

Comments
 (0)