Skip to content

Commit

Permalink
Reverse order release notes in sidebar
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Nola <derek.nola@suse.com>
  • Loading branch information
dereknola committed Jan 31, 2024
1 parent 5b22973 commit fc7cb75
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 73 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
workflow_dispatch

env:
MINORS: "v1.25 v1.26 v1.27 v1.28"
MINORS: "v1.26 v1.27 v1.28 v1.29"
permissions:
contents: write
pull-requests: write
Expand Down
1 change: 1 addition & 0 deletions docs/release-notes/v1.24.X.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
hide_table_of_contents: true
sidebar_position: 6
---

# v1.24.X
Expand Down
143 changes: 72 additions & 71 deletions docs/release-notes/v1.25.X.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/release-notes/v1.26.X.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
hide_table_of_contents: true
sidebar_position: 4
---

# v1.26.X
Expand Down
1 change: 1 addition & 0 deletions docs/release-notes/v1.27.X.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
hide_table_of_contents: true
sidebar_position: 3
---

# v1.27.X
Expand Down
1 change: 1 addition & 0 deletions docs/release-notes/v1.28.X.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
hide_table_of_contents: true
sidebar_position: 2
---

# v1.28.X
Expand Down
1 change: 1 addition & 0 deletions docs/release-notes/v1.29.X.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
hide_table_of_contents: true
sidebar_position: 1
---

# v1.29.X
Expand Down
11 changes: 10 additions & 1 deletion scripts/collect-all-release-notes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ for minor in $MINORS; do
body=$(gh release view "${patch}" -R "k3s-io/${product}" --json body -q '.body')
# Extract from each release notes the component table, building a single table with all the components
if [ -z "${previous}" ]; then
title="---\nhide_table_of_contents: true\n---\n\n# ${minor}.X\n"
title="---\nhide_table_of_contents: true\nsidebar_position: 0\n---\n\n# ${minor}.X\n"
echo -e "${title}" >> $k3s_table
upgrade_link="[Urgent Upgrade Notes](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-${minor:1}.md#urgent-upgrade-notes)"
upgrade_warning=":::warning Upgrade Notice\nBefore upgrading from earlier releases, be sure to read the Kubernetes ${upgrade_link}.\n:::\n"
Expand Down Expand Up @@ -52,3 +52,12 @@ for minor in $MINORS; do
cat $k3s_table "${file}" > $k3stmp && mv $k3stmp "${file}"
echo "Collected release notes for ${product} ${minor}"
done

# For all the releases, order the release notes in reverse numerical order
ITER=1
echo "Reordering release notes in sidebar"
for file in $(ls -r docs/release-notes/v1.*.X.md); do
# Add sidebar_position: $ITER to each release notes
sed -i "s/^sidebar_position:.*/sidebar_position: $ITER/" "${file}"
ITER=$((ITER+1))
done

0 comments on commit fc7cb75

Please sign in to comment.