Skip to content

Site: redesign shortcodes and partials producing GitHub links - #5411

Merged
adutra merged 1 commit into
apache:mainfrom
adutra:fix-github-polaris-partial
Sep 1, 2026
Merged

adutra merged 1 commit into
apache:mainfrom
adutra:fix-github-polaris-partial

Conversation

@adutra

@adutra adutra commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

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.

Checklist

  • 🛡️ Don't disclose security issues! (contact security@apache.org)
  • 🔗 Clearly explained why the changes are needed, or linked related issues: Fixes #
  • 🧪 Added/updated tests with good coverage, or manually tested (and explained how)
  • 💡 Added comments for complex logic
  • 🧾 Updated CHANGELOG.md (if needed)
  • 📚 Updated documentation in site/content/in-dev/unreleased (if needed)

Copilot AI lite review requested due to automatic review settings August 29, 2026 15:02
@github-project-automation github-project-automation Bot moved this to PRs In Progress in Basic Kanban Board Aug 29, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 -incubating to 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.

Comment thread site/layouts/shortcodes/github-polaris.html Outdated
dimas-b
dimas-b previously approved these changes Aug 29, 2026
@github-project-automation github-project-automation Bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board Aug 29, 2026
@adutra

adutra commented Aug 29, 2026

Copy link
Copy Markdown
Contributor Author

Note: I'm also deleting openapiUrl.html : it's unused and the template is very similar to github-polaris.html.

Note 2: github-polaris.html is also unused 😆 – but I'm planning to use it soon.

@adutra
adutra force-pushed the fix-github-polaris-partial branch from ea4135d to 44c7e77 Compare August 30, 2026 10:18
@adutra adutra changed the title Hugo site: fix github-polaris shortcode Site: redesign shortcodes and partials producing Github links Aug 30, 2026
@adutra
adutra force-pushed the fix-github-polaris-partial branch from 44c7e77 to cf1650a Compare August 30, 2026 10:19
@adutra adutra changed the title Site: redesign shortcodes and partials producing Github links Site: redesign shortcodes and partials producing GitHub links Aug 30, 2026
@adutra
adutra force-pushed the fix-github-polaris-partial branch from cf1650a to b262351 Compare August 30, 2026 10:27
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.
@adutra
adutra force-pushed the fix-github-polaris-partial branch from b262351 to 78711cc Compare August 30, 2026 10:28
@adutra

adutra commented Aug 30, 2026

Copy link
Copy Markdown
Contributor Author

@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 🙏

@adutra adutra mentioned this pull request Aug 30, 2026
6 tasks
@jbonofre
jbonofre self-requested a review August 31, 2026 14:05
@adutra
adutra merged commit 574e271 into apache:main Sep 1, 2026
24 checks passed
@github-project-automation github-project-automation Bot moved this from Ready to merge to Done in Basic Kanban Board Sep 1, 2026
@adutra
adutra deleted the fix-github-polaris-partial branch September 1, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants