Skip to content
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

Add support for nesting and collapsing sidebar groups #8218

Merged
merged 4 commits into from May 8, 2024

Conversation

delucis
Copy link
Member

@delucis delucis commented May 8, 2024

Description (required)

Updates our utility function mapping our nav.ts files to Starlight’s sidebar config shape to support nesting and collapsing groups.

Syntax

  • Nesting/collapsing is controlled from src/i18n/en/nav.ts. Other languages continue to work the same way, providing just the key–value mapping of translations.

  • Each heading (entries with header: true) can be marked as a nested group by adding nested: true.

  • Each heading (entries with header: true) can be marked as collapsed by default by adding collapsed: true.

  • I took a few shortcuts to keep this simple, which means nested groups have to be at the end of their containing group, i.e. the following is possible:

    Parent group     ▼
    |   Link 1
    |   Link 2
    |
    |   Sub group    ▼
    |   |   Link 3
    |   |   Link 4
    |
    |   Other group  ▼
    |   |   Link 5
    |
    Other group      ▼
    |   Link 6
    

    But this is not:

    Parent group     ▼
    |   Link 1
    |   Link 2
    |
    |   Sub group    ▼
    |   |   Link 3
    |   |   Link 4
    |
    |   Link 5
    |   Link 6
    |
    Other group      ▼
    |   Link 7
    

    Based on what I’ve seen so far, that seemed to align with intended usage, but let me know if it’s not!

Copy link

vercel bot commented May 8, 2024

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

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 8, 2024 2:38pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
docs-i18n ⬜️ Ignored (Inspect) May 8, 2024 2:38pm

@github-actions github-actions bot added the i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help! label May 8, 2024
@delucis delucis added the site improvement Some thing that improves the website functionality - ask @delucis for help! label May 8, 2024
@astrobot-houston
Copy link
Contributor

astrobot-houston commented May 8, 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 nav.ts 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.

Copy link
Member

@TheOtterlord TheOtterlord left a comment

Choose a reason for hiding this comment

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

LGTM! Managed to test implement the sidebar redesign with these changes

@delucis delucis merged commit 5cee97f into main May 8, 2024
8 checks passed
@delucis delucis deleted the dx-1242/sidebar-🪺 branch May 8, 2024 14:39
wpplumber pushed a commit to wpplumber/astro-docs that referenced this pull request May 9, 2024
wpplumber pushed a commit to wpplumber/astro-docs that referenced this pull request May 15, 2024
wpplumber pushed a commit to wpplumber/astro-docs that referenced this pull request May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help! 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.

None yet

3 participants