Skip to content

feat(docs): added links to github changelog to migration page headers#3604

Open
duvalale wants to merge 13 commits into
mainfrom
ouds/main-ad-links-to-guithub-changelog
Open

feat(docs): added links to github changelog to migration page headers#3604
duvalale wants to merge 13 commits into
mainfrom
ouds/main-ad-links-to-guithub-changelog

Conversation

@duvalale

@duvalale duvalale commented Jun 12, 2026

Copy link
Copy Markdown
Member

Related issues

Closes #3457

Description

Updated migration page headers to add link redirecting to matching changelog.

Checklists

Progression (for Core Team only)

Live previews

@netlify

netlify Bot commented Jun 12, 2026

Copy link
Copy Markdown

Deploy Preview for boosted ready!

Name Link
🔨 Latest commit fea4901
🔍 Latest deploy log https://app.netlify.com/projects/boosted/deploys/6a58f1b9f7eb500008c42f95
😎 Deploy Preview https://deploy-preview-3604--boosted.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@MaxLardenois MaxLardenois left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think it'd be better if the changelog link was on a dedicated link or button below the title (or on its right for wider viewports)
Here the link is not easily visible and it lacks an accessible text.

@boosted-bot boosted-bot moved this from Need Dev Review to Dev Review In Progress in 🟣 [Orange-Boosted-Bootstrap] PRs Board Jun 15, 2026
@duvalale
duvalale force-pushed the ouds/main-ad-links-to-guithub-changelog branch from 1c99711 to 0563034 Compare June 19, 2026 12:34
@duvalale

Copy link
Copy Markdown
Member Author

I updated the headers to add a dedicated link.
I had to use a remark and rehype plugins to be able to add the link and position it correctly in the DOM for keyboard navigation, otherwise, the focus order would have been incorrect (anchor-link focused after changelog link).

@MaxLardenois MaxLardenois left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice work!
I have some suggestion but nothing blocking so I will approve

Comment thread site/src/libs/utils.ts Outdated
Comment thread site/src/libs/remark.ts Outdated
Comment thread site/src/libs/rehype.ts
}

// A rehype plugin to reorder header anchor and version links
export const rehypeHeaderLinksOrder: Plugin<[], Root> = function () {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe we could simplify this by using the option before on rehypeAutolinkHeadings
This way the anchor-link would always be first (before the actual heading text), this would be that less to do.
But it works as is, just an idea.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I tried to keep the existing headers as is on purpose, but it is indeed simpler to move the anchor-link before the actual heading.
I removed the rehypeHeaderLinksOrder and updated the autolink conf.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I kept the existing header as is on purpose, but if I am allowed to update it, it is indeed better to prepend the anchor link.
It's done, and the rehypeHeaderLinksOrder is removed.

@MaxLardenois MaxLardenois Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sorry I was not clear: we should keep the end result as is (anchor-link after the heading text). But for this script I think it might be helpful if the anchor-link were always first, so that you only need to spilt the heading elements and reorder everytime, no need to find the anchor-link

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done as you suggested.
However, this does not simplify as much as I thought the function since we also have to manage the component icon displayed on some headings.

@duvalale
duvalale force-pushed the ouds/main-ad-links-to-guithub-changelog branch from d214b9e to 3a38f39 Compare June 25, 2026 14:48
@duvalale
duvalale force-pushed the ouds/main-ad-links-to-guithub-changelog branch from fcec38d to 8cd3170 Compare July 8, 2026 14:51
Comment thread site/src/libs/rehype.ts Fixed

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

Adds “Full changelog” links (with an external-link icon) to version headers in the Migration documentation, and adjusts the Markdown/HTML processing pipeline so heading anchors and generated IDs behave correctly with the new inline link content.

Changes:

  • Introduces a [[version-changelog-link]] marker and a remark plugin to inject a GitHub release link into version headings.
  • Updates rehype/markdown integration to change heading autolink behavior and reorder heading children.
  • Adds an external-link symbol to each brand’s SVG sprite so the injected link can display an icon.

Reviewed changes

Copilot reviewed 6 out of 9 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
site/static/sosh/docs/[version]/assets/img/ouds-web-sprite.svg Adds external-link symbol to sprite for Sosh docs.
site/static/orange/docs/[version]/assets/img/ouds-web-sprite.svg Adds external-link symbol to sprite for Orange docs.
site/static/orange-compact/docs/[version]/assets/img/ouds-web-sprite.svg Adds external-link symbol to sprite for Orange Compact docs.
site/src/libs/utils.ts Adds helpers for generating the version changelog link + heading detection.
site/src/libs/toc.ts Strips “Full changelog” from heading text when generating ToC entries.
site/src/libs/remark.ts Adds remark plugin to inject version changelog link HTML into headings.
site/src/libs/rehype.ts Adds rehype plugins for heading child ordering and heading-id adjustment.
site/src/libs/astro.ts Wires new remark/rehype plugins into Astro markdown configuration and changes autolink behavior.
site/src/content/docs/getting-started/migration.mdx Adds the [[version-changelog-link]] marker to version headings.

Comment thread site/src/libs/utils.ts
Comment thread site/src/libs/utils.ts Outdated
Comment thread site/src/libs/astro.ts
Comment thread site/src/libs/astro.ts
Comment thread site/src/libs/rehype.ts Outdated
Comment thread site/src/libs/rehype.ts Outdated
Comment thread site/src/content/docs/getting-started/migration.mdx
@MaxLardenois

Copy link
Copy Markdown
Collaborator

There is two issues in the result :

  • a single " is present on the changelog link
  • the icon is not visible

@duvalale
duvalale force-pushed the ouds/main-ad-links-to-guithub-changelog branch from 82f872a to cb08b0d Compare July 9, 2026 08:08

@louismaximepiton louismaximepiton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm fine with the changes, tbh I think we could go through the frontmatter instead of a remark thing since all the title h2 are changed on the page. However, it works like a charm so I'm fine with the changes, if you wanna merge as-is.

Comment thread site/src/libs/utils.ts
}

export function getVersionLink(version: string): string {
return `<a class="link icon-link float-end p-none" href="https://github.com/Orange-OpenSource/Orange-Boosted-Bootstrap/releases/tag/${version}-ouds-web" target="_blank" rel="noopener">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not a big fan of using float-end, but can't figure out how to achieve the smae thing in a different way.

Comment thread site/src/libs/toc.ts Outdated

for (const heading of headings) {
if (heading.text.includes('Full changelog')) {
heading.text = heading.text.replace(' Full changelog', '')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think that we don't need the condition above to run the line.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Indeed, updated

Comment thread site/src/libs/utils.ts
}

export function getHeadingSlug(str: string) {
return str.replace(/-------full-changelog---------------------/g, '')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I can't figure out why we have this specific string ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

From what I understand, rehypeHeadingIds generates slug from the content of the whole node, which includes the "full changelog" link, and generates this string.
If I don't remove it, the generated slug when clicking on anchor or TOC is #vXYZ-------full-changelog---------------------, which is not pretty in the URL.

Comment thread site/src/libs/rehype.ts
}

// A rehype plugin to reorder header anchor link and header text
export const rehypeHeaderLinksOrder: Plugin<[], Root> = function () {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I quite don't unserstand why we do want them in this exact order, I think title -> Full changelog -> anchor is fine no ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

If I don't reorder them, the DOM will not reflect the reading/display order, and keyboard navigation won't match what the user sees : We will see title -> anchor -> full changelog, and keyboard navigation order will be title -> full changelog -> anchor.

@boosted-bot boosted-bot moved this from Dev Review In Progress to Need Lead Dev Review in 🟣 [Orange-Boosted-Bootstrap] PRs Board Jul 16, 2026
@duvalale
duvalale force-pushed the ouds/main-ad-links-to-guithub-changelog branch from 94e305b to fea4901 Compare July 16, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Need Lead Dev Review

Development

Successfully merging this pull request may close these issues.

[OUDS] Add link to GitHub changelog

5 participants