-
-
Notifications
You must be signed in to change notification settings - Fork 810
Add support for custom icons #3024
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
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. |
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
|
* main: (43 commits) [ci] format i18n(ru): update some translations (withastro#3029) chore(deps): update zephyrproject-rtos/action-first-interaction digest to 5885399 (withastro#3027) [ci] release (withastro#3022) feat: add sourcehut as social option (withastro#3020) feat: Add Substack icon to social list (withastro#3013) [ci] format i18n(zh-cn): Update `overrides.md` and `overriding-components.mdx` (withastro#3006) [ci] format i18n(zh-cn): Update `i18n.mdx` and Update `plugins.md` (withastro#2940) i18n(ko-KR): update `ko.json` (withastro#3021) i18n(fr): update `resources/themes` (withastro#3019) [ci] format Update themes.mdx (withastro#3016) i18n(ko-KR): update `theme.mdx` (withastro#3015) Add starlight theme nova (withastro#3012) i18n(fr): update `reference/plugins.md` (withastro#3011) i18n(ko-KR): update `plugins.md` (withastro#3010) i18n(de): update `plugins.mdx` (withastro#3009) Fix code example in plugin reference (withastro#3005) ...
Description
This PR is a very early draft adding support for Iconify and local icons in Starlight.
The early draft PR is opened to provide some material for discussions and also evaluate potential changes in involved libraries. A lot of work, including more robust implementations for some parts, more tests, and documentation, is still needed.
Preview test page: https://deploy-preview-3024--astro-starlight.netlify.app/test/
Implementation
Most of the implementation relies on the Astro Icon library, altho Starlight does not only uses icons through components but also in different contexts, e.g. remark plugins.
A few high-level details about the implementation:
Astro Icon configuration
Astro Icon is an integration that supports various configuration options.
Just like
expressiveCode
, Astro Icon options are currently exposed using anicons
(placeholder name) property in the Starlight configuration.Astro Icon notes
Here are a few notes about Astro Icon that I gathered so far that I would like to discuss with the maintainers of the project (still need to put them in a more friendly format):
NODE_ENV
is set toproduction
.--prod=false
to the list command from my initial and quick tests. Will need to investigate more.@iconify/utils
helperloadCollectionFromFS()
to load collections, by default this helper usesprocess.cwd()
to load collections. Same goes for theimportDirectory()
helper in@iconify/tools
used to load local icons.Remaining tasks
// TODO(HiDeoo)
comments@astrojs/starlight
@astrojs/starlight-markdoc
docs/src/icons/test.svg
docs/src/content/docs/test.mdx
examples/markdoc/src/content/docs/test.mdoc
@iconify-json/mdi
fromstarlight-docs
and@example/starlight-markdoc