Skip to content

Commit 869cb58

Browse files
committed
add /latest alias with redirect:to strategy in Antora playbooks
1 parent 5a07c47 commit 869cb58

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/merge-build-push.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,16 @@ jobs:
9191
else
9292
echo "WARNING: DETECTED_VERSION is empty. Skipping start_page update for $PLAYBOOK_FILE."
9393
fi
94+
95+
# Add / support symbolic paths for the latest version + redirect:to
96+
yq -i '.urls //= {}' "$PLAYBOOK_FILE" # If the urls key does not exist, first create an empty object.
97+
98+
yq -i '.urls.latest_version_segment = "latest"' "$PLAYBOOK_FILE"
99+
yq -i '.urls.latest_version_segment_strategy = "redirect:to"' "$PLAYBOOK_FILE"
100+
101+
echo "Set urls.latest_version_segment = latest"
102+
echo "Set urls.latest_version_segment_strategy = redirect:to"
103+
94104
echo "Modified content of $PLAYBOOK_FILE:"
95105
cat "$PLAYBOOK_FILE"
96106
echo "--- Finished modification for $PLAYBOOK_FILE ---"

0 commit comments

Comments
 (0)