Skip to content

Conversation

ArmandPhilippot
Copy link
Member

Description (required)

Fixes the docgen script to remove /en/reference/configuration-reference/ from internal anchor links.

The changes was introduced by withastro/astro#14411 because relative links do not work in editors.
Now, instead of [redirects](#redirects) we have [redirects](/en/reference/configuration-reference/#redirects) (for example).

Both works, but maybe we should clean the links as we do to make them relative instead of absolute?

(I don't have a strong opinion on this, it just seemed weird while I was updating the French translation. So feel free to tell me to close this one 😄 )

Related issues & labels (optional)

  • Suggested label: site improvement?

@ArmandPhilippot ArmandPhilippot added the site improvement Some thing that improves the website functionality - ask @delucis for help! label Sep 23, 2025
Copy link

netlify bot commented Sep 23, 2025

Deploy Preview for astro-docs-2 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 418133a
🔍 Latest deploy log https://app.netlify.com/projects/astro-docs-2/deploys/68e3f1337b9b45000838cf66
😎 Deploy Preview https://deploy-preview-12405--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@ArmandPhilippot ArmandPhilippot changed the title fix: remove page slug from anchor links fix(configuration-reference): remove page slug from internal anchor links Sep 23, 2025
@sarah11918
Copy link
Member

sarah11918 commented Sep 23, 2025

Thank you, Armand!

OK, so as I see it what happened was:

  • [redirects](#redirects) in docgen produced valid links of the form [redirects](#redirects) in our configuration reference page. (yay!)
  • however, [redirects](#redirects) in docgen meant that editor hover links in the editor didn't work (boo!)
  • So, we changed the docgen source to read [redirects](/en/reference/configuration-reference/#redirects) which shows editor hover links (yay!) and produces valid links in our configuration reference page (yay!)
  • however, now the links in the configuration source page are the longer [redirects](/en/reference/configuration-reference/#redirects) format (boo!)

So this PR would allow us to type [redirects](/en/reference/configuration-reference/#redirects) in the docgen source, but the resulting code imported into the docs repo for generating the page itself would be [redirects](#redirects). Did I get that summary correct?

I will let @delucis review this one when he returns! 😅

@ArmandPhilippot
Copy link
Member Author

The formatting is broken, but after checking with "Edit": this is exactly that! 😅

@trueberryless
Copy link
Contributor

Sarah, we need more yay!s:

So this PR would allow us to type [redirects](/en/reference/configuration-reference/#redirects) in the docgen source, but the resulting code imported into the docs repo for generating the page itself would be [redirects](#redirects).

(yay!)(yay!)

Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

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

Code change LGTM! Did you try running this locally just to double check it works @ArmandPhilippot?

@ArmandPhilippot
Copy link
Member Author

@delucis Yes! I checked again and didn't spotted any unwanted changes or oversights!

Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

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

Perfect, then I approve! Thanks @ArmandPhilippot 🎉

@ArmandPhilippot ArmandPhilippot merged commit 48f7905 into withastro:main Oct 6, 2025
10 checks passed
@ArmandPhilippot ArmandPhilippot deleted the fix/docgen-script branch October 6, 2025 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

site improvement Some thing that improves the website functionality - ask @delucis for help!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants