* 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_ENVis set toproduction.--prod=falseto the list command from my initial and quick tests. Will need to investigate more.@iconify/utilshelperloadCollectionFromFS()to load collections, by default this helper usesprocess.cwd()to load collections. Same goes for theimportDirectory()helper in@iconify/toolsused to load local icons.Remaining tasks
// TODO(HiDeoo)comments@astrojs/starlight@astrojs/starlight-markdocdocs/src/icons/test.svgdocs/src/content/docs/test.mdxexamples/markdoc/src/content/docs/test.mdoc@iconify-json/mdifromstarlight-docsand@example/starlight-markdoc