-
-
Notifications
You must be signed in to change notification settings - Fork 530
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
Aside: Support custom icons #2261
base: main
Are you sure you want to change the base?
Conversation
|
✅ Deploy Preview for astro-starlight ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Hello! Thank you for opening your first PR to Starlight! ✨ Here’s what will happen next:
|
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
6f13b2b
to
ba8211d
Compare
Astro helps you build faster websites with [“Islands Architecture”](https://docs.astro.build/en/concepts/islands/). | ||
::: | ||
``` | ||
|
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.
I'm not sure whether this should have a different header of its own or should we just specify it along with the custom aside title markdown
ba8211d
to
999fbce
Compare
iconPath = [s('path', properties)]; | ||
} | ||
} | ||
|
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.
This feels a bit ugly-ish to me, any pointers to improve this would be welcome!
const iconName = attributes['icon'] as keyof typeof Icons; | ||
if (!Object.keys(Icons).includes(iconName)) { | ||
throw new AstroError("Icon name should be part of Starlight's icon list."); | ||
} |
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.
I've put a placeholder error for now, please feel free to suggest another error message that might follow starlight's guidelines.
Only built-icons will be supported for now. This commit does not add support for the `:::` markdown shorthand for defining an aside, that will be done in the next commit.
999fbce
to
da7a1b7
Compare
Bumping this up for review, thanks! |
Description
This PR adds the ability to pass icon attribute to the Aside component. This icon attribute can be any icon supported by starlight by default.