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 <Aside> component #1499

Merged
merged 6 commits into from
Feb 16, 2024
Merged

Add <Aside> component #1499

merged 6 commits into from
Feb 16, 2024

Conversation

delucis
Copy link
Member

@delucis delucis commented Feb 16, 2024

Description

  • Adds an Aside Astro component to our @astrojs/starlight/components module.
  • Produces the same markup as the existing :::note-style asides available in Markdown and MDX.

Notes

  • I had initially thought it would be ideal to share the HTML-building logic between this component, but when I looked at it, it felt kind of silly: the component is so simple that pulling the full hastscript pipeline feels wrong. It does mean some duplication — changes would require updating in two places — but given how minimal this is, I think this is OK.

  • This PR copy/pastes the urlToSlug() helper added in "Virtual" pages prototype #1175 so it can use it — will resolve the conflicts once "Virtual" pages prototype #1175 is merged.

Copy link

changeset-bot bot commented Feb 16, 2024

🦋 Changeset detected

Latest commit: 89577ae

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 Minor

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

Copy link

vercel bot commented Feb 16, 2024

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

Name Status Preview Updated (UTC)
starlight ✅ Ready (Inspect) Visit Preview Feb 16, 2024 10:41pm
1 Ignored Deployment
Name Status Preview Updated (UTC)
starlight-i18n ⬜️ Ignored (Inspect) Feb 16, 2024 10:41pm

@github-actions github-actions bot added 📚 docs Documentation website changes 🌟 core Changes to Starlight’s main package labels Feb 16, 2024
@astrobot-houston
Copy link
Collaborator

astrobot-houston commented Feb 16, 2024

size-limit report 📦

Path Size
/index.html 5.23 KB (0%)
/_astro/*.js 21.54 KB (0%)
/_astro/*.css 13.13 KB (0%)

Copy link
Member

@HiDeoo HiDeoo left a comment

Choose a reason for hiding this comment

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

I had initially thought it would be ideal to share the HTML-building logic between this component, but when I looked at it, it felt kind of silly: the component is so simple that pulling the full hastscript pipeline feels wrong. It does mean some duplication — changes would require updating in two places — but given how minimal this is, I think this is OK.

I guess one could say that we could extract the variants and isAsideVariant from the remark plugin but considering we are already duplicating the SVGs and that we are not likely to have to update the variants often, I think it's fine to keep it as is and that it was a good call to not pull everything 👍

Really simple and nice component with a great error message for invalid types 🌟

Approving for later.

docs/src/content/docs/guides/components.mdx Show resolved Hide resolved
Copy link
Sponsor Member

@kevinzunigacuellar kevinzunigacuellar left a comment

Choose a reason for hiding this comment

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

Looks good to me! 💜

@delucis delucis added the 🌟 minor Change that triggers a minor release label Feb 16, 2024
@delucis delucis merged commit 97bf523 into main Feb 16, 2024
9 checks passed
@delucis delucis deleted the dx-1007/aside branch February 16, 2024 22:43
@astrobot-houston astrobot-houston mentioned this pull request Feb 16, 2024
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.

None yet

4 participants