-
-
Notifications
You must be signed in to change notification settings - Fork 551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Link to Astro docs for heading anchor link generation #1010
Conversation
…ly accepts lowecase anchors with no space Added: :::note **Convert to Lowercase:** Ensure that all characters in the heading titles used for anchor links are in lowercase. <br/> **No Spaces in Titles:** Titles with spaces cannot be used as anchor links. Consider using hyphens to separate words (my-section instead of My Section) for better compatibility. :::
|
✅ Deploy Preview for astro-starlight ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello! Thank you for opening your first PR to Starlight! ✨
Here’s what will happen next:
-
Our GitHub bots will run to check your changes.
If they spot any issues you will see some error messages on this PR.
Don’t hesitate to ask any questions if you’re not sure what these mean! -
In a few minutes, you’ll be able to see a preview of your changes on Netlify 🤩
-
One or more of our maintainers will take a look and may ask you to make changes.
We try to be responsive, but don’t worry if this takes a few days.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR @onurusluca! The heading ID generator does a few more things — it is based on https://github.com/Flet/github-slugger. I also wonder whether it would be better to document this on the Astro docs Markdown page and link to it? We just use Astro’s default anchor link behaviour, so it’s not Starlight specific. What do you think?
@delucist Thanks for the reply. We can definitely link to the page. Let me fix the commit. |
@delucis Is this better maybe? You are welcome to change it. :::note No Spaces in Titles: If your title has spaces, replace spaces with hyphens(-). Starlight uses the same Heading IDS logic |
Hey there @onurusluca! I've made a PR to the Astro docs itself. I feel like that's a better place to document this, since it's the same behaviour for both Starlight and Astro. We can link to that page from Starlight. How does that sound? PR here: withastro/docs#5300 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since I added this piece of documentation to the main Astro Docs, we can link to that instead of writing it out here.
@ElianCodes Thanks a lot. Also thanks for the fix-upm Gonna close this as it was handled at Astro docs which is a better solution than this. |
No worries at all, altho I still think we do want to link to the new explanation in the Astro Docs as @ElianCodes suggested so I'm gonna reopen this PR to double check that. |
Co-authored-by: Elian <[email protected]>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks everyone for the work on this PR — I think this looks good now 🙌
What kind of changes does this PR include?
Description
It may be difficult to understand how to correctly set anchor links for some people.
Update authoring-content.md about automatic anchoring to clarify that automatic anchor links only accepts lowecase anchors with no space.
Added: