Skip to content

Feat: Autogenerate sidebar labels#1874

Merged
delucis merged 39 commits into
withastro:mainfrom
lorenzolewis:feat/autogenerate-sidebar-titles
Jul 5, 2024
Merged

Feat: Autogenerate sidebar labels#1874
delucis merged 39 commits into
withastro:mainfrom
lorenzolewis:feat/autogenerate-sidebar-titles

Conversation

@lorenzolewis
Copy link
Copy Markdown
Contributor

@lorenzolewis lorenzolewis commented May 15, 2024

Description

  • Resolves Autogenerate label for sidebar links #1630
  • Now using a sidebar entry with the key slug to specify the file will dynamically pull in that file's title
  • Update any relevant Starlight docs entries to move their translations out of the config and to the respective content files These will be done in a separate follow-up PR to not trigger i18n

TODOs

  • Do the test updates look alright? I added on to the current tests instead of breaking out into a separate one, but can do that if wanted
  • Changeset
  • Docs updates

@vercel
Copy link
Copy Markdown

vercel Bot commented May 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
starlight ✅ Ready (Inspect) Visit Preview Jul 5, 2024 10:55am

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 15, 2024

🦋 Changeset detected

Latest commit: 07c0696

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@astrojs/starlight Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added 📚 docs Documentation website changes 🌟 core Changes to Starlight’s main package labels May 15, 2024
@astrobot-houston
Copy link
Copy Markdown
Contributor

astrobot-houston commented May 21, 2024

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

Locale File Note
en guides/sidebar.mdx Source changed, localizations will be marked as outdated.
en reference/configuration.mdx Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@github-actions github-actions Bot added the i18n Anything to do with internationalization & translation efforts label May 21, 2024
@github-actions github-actions Bot removed the i18n Anything to do with internationalization & translation efforts label May 21, 2024
@lorenzolewis lorenzolewis marked this pull request as ready for review May 21, 2024 15:03
@delucis delucis added the 🌟 minor Change that triggers a minor release label Jun 5, 2024
@andrii-bodnar
Copy link
Copy Markdown
Contributor

Wow! Very nice feature, it will greatly improve the DX!

I also faced this and it feels uncomfortable especially when the sidebar contains autogenerated groups and some manually added items. In this case, the autogenerated pages define their sidebar title in the Front Matter section. At the same time, the manual items should define it in the sidebar configuration.

This is also bad for i18n, because the labels for manually added items should be localized separately using the translations configuration.

Waiting for this to ship! 🚀

@lorenzolewis
Copy link
Copy Markdown
Contributor Author

LGTM!

@kmalloy24
Copy link
Copy Markdown

I was just looking for this functionality this morning, perfect timing, and great work! Thank you 🙏

Yoxnear pushed a commit to Yoxnear/starlight-custom that referenced this pull request Jul 23, 2025
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🌟 core Changes to Starlight’s main package 📚 docs Documentation website changes 🌟 minor Change that triggers a minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants