Skip to content

Instantly share code, notes, and snippets.

Last active November 14, 2022 23:23
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
A Bash script for automating repetitive pull request creation
# call this script like this:
# `./ 7.18`
# where 7.18 is the target version/branch.
# set up a branch for this work
git switch $VERSION
git branch $BRANCH
git switch $BRANCH
# update the theme
cd ../camunda-docs-theme
npm run build && npm run optimize
# commit the updated theme
cd ../camunda-docs-manual
git add themes/camunda/assets/js
git add themes/camunda/layouts
git commit -m "chore: update theme"
# undo the updated theme css
git restore themes/camunda/assets/css
# update the config.yaml
sed -i '' -E 's/baseURL: \"(.*)\"/baseURL: \"https:\/\/\1\"/g' config.yaml
# commit the updated config
git add config.yaml
git commit -m "feat: fully qualify baseURL so that sitemap and rel=canonical links get built correctly"
# re-generate the site for screenshots
# push up branch
git push origin
# open a PR
TITLE="feat: canonicals($VERSION) -- fix sitemap & apply rel=canonical strategy to $VERSION branch"
BODY="Part of
1. Updates the theme based on
2. Fully qualifies the \`baseURL\` setting so that sitemap is valid, and rel=canonical can be set
3. Applies the rel=canonical strategy discussed in
## Proof that the sitemap gets generated with absolute URLs
I ran a build locally and this is the generated sitemap:
## Proof that pages are generated with a versionless rel=canonical
I ran a build locally and this is the generated page for \`/manual/$VERSION/user-guide/security/\`:
# -a = assignee
# -B = baseline for the PR
gh pr create --web -t "$TITLE" -a @me -B $VERSION -b "$BODY"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment