Site: redesign shortcodes and partials producing GitHub links - #5411
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes the Hugo github-polaris shortcode so it generates correct GitHub URLs for both unreleased docs (main branch) and released docs (versioned tags), including incubator-era tag suffixes.
Changes:
- Add logic to append
-incubatingto release tags for versions prior to 1.4.0. - Fix the release tag prefix to use
apache-polaris-...and correctly include the version in the URL. - Normalize Hugo template whitespace trimming in the generated URL output.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Note: I'm also deleting Note 2: |
ea4135d to
44c7e77
Compare
44c7e77 to
cf1650a
Compare
cf1650a to
b262351
Compare
The existing partials and shortcodes generally had bugs: - Incorrect handling of the `-incubating` suffix - Incorrect naming of release tags - Duplicated logic in many places This PR introduces new partials: - A new `incubatingSuffix.html` partial that correctly outputs the `-incubating` suffix when appropriate; - A new `polarisGitRef.html` partial that outputs a dict with info about a Git ref; - A new `githubPolarisUrl.html` partial that outputs standard GitHub URLs for a given ref; - A new `rawGithubPolarisUrl.html` partial that outputs raw-style GitHub URLs for a given ref. It also introduces a new `raw-github-polaris.html` shortcode that just calls the `rawGithubPolarisUrl.html` partial. The existing `github-polaris.html` shortcode is modified to just call the `githubPolarisUrl.html` partial. The old `openapiUrl.html` partial is removed. It seems to represent an old state of the URL-computing logic found in `redoc-polaris.html`. It is now superseded by `rawGithubPolarisUrl.html`. Finally, the `redoc-polaris.html` shortcode is modified to call the `rawGithubPolarisUrl.html` partial.
b262351 to
78711cc
Compare
|
@dimas-b and other reviewers: apologies for the confusion. I broadened the scope of this PR after discovering more places where the wrong incubating suffix logic was being used/duplicated. In this PR, no logic is duplicated anymore and partials are introduced for both GitHub standard and "raw" URLs. PTAL again 🙏 |
The existing partials and shortcodes generally had bugs:
-incubatingsuffixThis PR introduces new partials:
incubatingSuffix.htmlpartial that correctly outputs the-incubatingsuffix when appropriate;polarisGitRef.htmlpartial that outputs a dict with info about a Git ref;githubPolarisUrl.htmlpartial that outputs standard GitHub URLs for a given ref;rawGithubPolarisUrl.htmlpartial that outputs raw-style GitHub URLs for a given ref.It also introduces a new
raw-github-polaris.htmlshortcode that just calls therawGithubPolarisUrl.htmlpartial.The existing
github-polaris.htmlshortcode is modified to just call thegithubPolarisUrl.htmlpartial.The old
openapiUrl.htmlpartial is removed. It seems to represent an old state of the URL-computing logic found inredoc-polaris.html. It is now superseded byrawGithubPolarisUrl.html.Finally, the
redoc-polaris.htmlshortcode is modified to call therawGithubPolarisUrl.htmlpartial.Checklist
CHANGELOG.md(if needed)site/content/in-dev/unreleased(if needed)