├── .changeset ├── README.md └── config.json ├── .devcontainer ├── Dockerfile ├── devcontainer.json └── welcome-message.txt ├── .git-blame-ignore-revs ├── .github ├── DISCUSSION_TEMPLATE │ ├── docs-suggestions.yml │ └── feature-requests.yml ├── ISSUE_TEMPLATE │ ├── ---01-bug-report.yml │ ├── ---02-docs-issue.yml │ └── config.yml ├── PULL_REQUEST_TEMPLATE.md ├── labeler.yml ├── renovate.json5 └── workflows │ ├── ci.yml │ ├── congratsbot.yml │ ├── file-icons.yml │ ├── format.yml │ ├── lunaria.yml │ ├── pr-labeler.yml │ ├── release.yml │ ├── size-limit.yml │ └── welcome-bot.yml ├── .gitignore ├── .npmrc ├── .prettierignore ├── .prettierrc ├── .vscode ├── extensions.json └── launch.json ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── docs ├── .gitignore ├── .pa11yci ├── README.md ├── __a11y__ │ ├── docs.test.ts │ └── test-utils.ts ├── astro.config.mjs ├── grammars │ ├── README.md │ ├── generate.mjs │ └── markdoc.tmLanguage.json ├── lunaria.config.json ├── lunaria │ ├── components.ts │ ├── renderer.config.ts │ └── styles.css ├── package.json ├── playwright.config.ts ├── public │ ├── _headers │ ├── _redirects │ ├── favicon.svg │ └── og.jpg ├── src │ ├── assets │ │ ├── hero-star.webp │ │ ├── landing.css │ │ ├── logo-dark.svg │ │ ├── logo-light.svg │ │ ├── robots.txt │ │ ├── showcase │ │ │ ├── accessible-astro.incluud.dev.png │ │ │ ├── ai-prompt-snippets.png │ │ │ ├── api.dipsway.com.png │ │ │ ├── astro-ghostcms.xyz.png │ │ │ ├── astro-snipcart.png │ │ │ ├── brycerussell.github.io-qbcore-docs.png │ │ │ ├── capgo.app.png │ │ │ ├── capo.js.png │ │ │ ├── codesweetly.com.png │ │ │ ├── contribute.freecodecamp.org.png │ │ │ ├── crawler.siteone.io.png │ │ │ ├── create.bingo.png │ │ │ ├── csmos.space.png │ │ │ ├── dev.vrchatfrance.fr.png │ │ │ ├── developers.cloudflare.com.png │ │ │ ├── dmno.dev.png │ │ │ ├── docs.astronvim.com.png │ │ │ ├── docs.cookie-api.com.png │ │ │ ├── docs.emojiblast.dev.png │ │ │ ├── docs.ethfollow.xyz.png │ │ │ ├── docs.flojoy.ai.png │ │ │ ├── docs.fontawesome.com.png │ │ │ ├── docs.ghostfam.com.png │ │ │ ├── docs.mrrobot.app.png │ │ │ ├── docs.orama.com.png │ │ │ ├── docs.papermc.io.png │ │ │ ├── docs.reactbricks.com.png │ │ │ ├── docs.ryzekit.com.png │ │ │ ├── document.saasfly.io.png │ │ │ ├── drops-of-php.hi-folks.dev.png │ │ │ ├── ee.qqv.com.au.png │ │ │ ├── feedbackspark.com.png │ │ │ ├── felicity.pages.dev.png │ │ │ ├── fluid-dnd.png │ │ │ ├── folksrouter.io.png │ │ │ ├── grpc.md.png │ │ │ ├── har.fyi.png │ │ │ ├── how2neovim.io.png │ │ │ ├── ion.sst.dev.png │ │ │ ├── itihon.github.io-isomorphic-validation.png │ │ │ ├── kanriapp.com.png │ │ │ ├── kinde.com.png │ │ │ ├── knip.dev.png │ │ │ ├── launchfa.st.png │ │ │ ├── learnaiso.com.png │ │ │ ├── nostalgist.js.org.png │ │ │ ├── octo.guide.png │ │ │ ├── onerepo.tools.png │ │ │ ├── openresource.dev.png │ │ │ ├── opensaas.sh.png │ │ │ ├── pls.cli.rs.png │ │ │ ├── pokemon-siace.netlify.app.png │ │ │ ├── quotesdomain.com.png │ │ │ ├── react-awesome-reveal.morello.dev.png │ │ │ ├── refact.ai.png │ │ │ ├── runs-on.com.png │ │ │ ├── screenshotone.com.png │ │ │ ├── secco.lekoarts.de.png │ │ │ ├── sibiraj-s.github.io-ngx-editor.png │ │ │ ├── sonar-team.github.io.png │ │ │ ├── starter.obytes.com.jpg │ │ │ ├── styledictionary.com.png │ │ │ ├── terrateam.io-docs.png │ │ │ ├── texttotableconverter.com.png │ │ │ ├── truecharts.org.png │ │ │ ├── tutorialkit.dev.png │ │ │ ├── ucexlly.com.png │ │ │ ├── ui.full.dev.png │ │ │ ├── webmonetization.org.png │ │ │ ├── www.athenaos.org.png │ │ │ ├── www.devhealthos.com.png │ │ │ ├── www.pydocs.site.png │ │ │ ├── xs-dev.js.org.png │ │ │ ├── yummacss.com.png │ │ │ └── zumerlab.github.io.orbit-docs.png │ │ ├── testimonials │ │ │ ├── BowTiedWebReapr.jpg │ │ │ ├── J_Everhart383.jpg │ │ │ ├── RmeetsH.jpg │ │ │ ├── SylwiaVargas.jpg │ │ │ ├── beaussan.jpg │ │ │ ├── flaviocopes.jpg │ │ │ ├── jhooks.jpg │ │ │ ├── loucyx.jpg │ │ │ ├── rachelnabors.jpg │ │ │ ├── rick_viscomi.jpg │ │ │ ├── solelychloe.jpg │ │ │ └── sulco.jpg │ │ └── themes │ │ │ ├── black-dark.png │ │ │ ├── black-light.png │ │ │ ├── catppuccin-dark.png │ │ │ ├── catppuccin-light.png │ │ │ ├── flexoki-dark.png │ │ │ ├── flexoki-light.png │ │ │ ├── ion-dark.png │ │ │ ├── ion-light.png │ │ │ ├── nextjs-dark.png │ │ │ ├── nextjs-light.png │ │ │ ├── nova-dark.png │ │ │ ├── nova-light.png │ │ │ ├── obsidian-dark.png │ │ │ ├── obsidian-light.png │ │ │ ├── rapide-dark.png │ │ │ └── rapide-light.png │ ├── components │ │ ├── about-astro.astro │ │ ├── component-preview.astro │ │ ├── fluid-grid.astro │ │ ├── icons-list.astro │ │ ├── languages-list.astro │ │ ├── media-card.astro │ │ ├── showcase-card.astro │ │ ├── showcase-sites.astro │ │ ├── sidebar-preview.astro │ │ ├── social-links-type.astro │ │ ├── testimonial-grid.astro │ │ ├── testimonial.astro │ │ ├── theme-designer.astro │ │ ├── theme-designer │ │ │ ├── atom.ts │ │ │ ├── color-editor.astro │ │ │ ├── color-lib.ts │ │ │ ├── contrast-level.astro │ │ │ ├── palette.astro │ │ │ ├── presets.astro │ │ │ ├── preview.astro │ │ │ ├── store.ts │ │ │ └── value-slider.astro │ │ ├── theme-grid.astro │ │ ├── theme-image.astro │ │ ├── ui-strings-list.astro │ │ ├── youtube-card.astro │ │ └── youtube-grid.astro │ ├── content.config.ts │ └── content │ │ ├── docs │ │ ├── 404.md │ │ ├── components │ │ │ ├── asides.mdx │ │ │ ├── badges.mdx │ │ │ ├── card-grids.mdx │ │ │ ├── cards.mdx │ │ │ ├── code.mdx │ │ │ ├── file-tree.mdx │ │ │ ├── icons.mdx │ │ │ ├── link-buttons.mdx │ │ │ ├── link-cards.mdx │ │ │ ├── steps.mdx │ │ │ ├── tabs.mdx │ │ │ └── using-components.mdx │ │ ├── da │ │ │ ├── 404.md │ │ │ ├── guides │ │ │ │ └── project-structure.mdx │ │ │ └── index.mdx │ │ ├── de │ │ │ ├── 404.md │ │ │ ├── components │ │ │ │ ├── asides.mdx │ │ │ │ ├── badges.mdx │ │ │ │ ├── card-grids.mdx │ │ │ │ ├── cards.mdx │ │ │ │ ├── code.mdx │ │ │ │ ├── file-tree.mdx │ │ │ │ ├── icons.mdx │ │ │ │ ├── link-buttons.mdx │ │ │ │ ├── link-cards.mdx │ │ │ │ ├── steps.mdx │ │ │ │ ├── tabs.mdx │ │ │ │ └── using-components.mdx │ │ │ ├── environmental-impact.md │ │ │ ├── getting-started.mdx │ │ │ ├── guides │ │ │ │ ├── authoring-content.mdx │ │ │ │ ├── css-and-tailwind.mdx │ │ │ │ ├── customization.mdx │ │ │ │ ├── i18n.mdx │ │ │ │ ├── overriding-components.mdx │ │ │ │ ├── pages.mdx │ │ │ │ ├── project-structure.mdx │ │ │ │ ├── route-data.mdx │ │ │ │ ├── sidebar.mdx │ │ │ │ └── site-search.mdx │ │ │ ├── index.mdx │ │ │ ├── manual-setup.mdx │ │ │ ├── reference │ │ │ │ ├── configuration.mdx │ │ │ │ ├── frontmatter.md │ │ │ │ ├── icons.mdx │ │ │ │ ├── overrides.md │ │ │ │ ├── plugins.md │ │ │ │ └── route-data.mdx │ │ │ └── resources │ │ │ │ ├── community-content.mdx │ │ │ │ ├── plugins.mdx │ │ │ │ ├── showcase.mdx │ │ │ │ └── themes.mdx │ │ ├── environmental-impact.md │ │ ├── es │ │ │ ├── 404.md │ │ │ ├── components │ │ │ │ ├── asides.mdx │ │ │ │ ├── badges.mdx │ │ │ │ ├── card-grids.mdx │ │ │ │ ├── cards.mdx │ │ │ │ ├── code.mdx │ │ │ │ ├── file-tree.mdx │ │ │ │ ├── icons.mdx │ │ │ │ ├── link-buttons.mdx │ │ │ │ ├── link-cards.mdx │ │ │ │ ├── steps.mdx │ │ │ │ ├── tabs.mdx │ │ │ │ └── using-components.mdx │ │ │ ├── environmental-impact.md │ │ │ ├── getting-started.mdx │ │ │ ├── guides │ │ │ │ ├── authoring-content.mdx │ │ │ │ ├── css-and-tailwind.mdx │ │ │ │ ├── customization.mdx │ │ │ │ ├── i18n.mdx │ │ │ │ ├── overriding-components.mdx │ │ │ │ ├── pages.mdx │ │ │ │ ├── project-structure.mdx │ │ │ │ ├── route-data.mdx │ │ │ │ ├── sidebar.mdx │ │ │ │ └── site-search.mdx │ │ │ ├── index.mdx │ │ │ ├── manual-setup.mdx │ │ │ ├── reference │ │ │ │ ├── configuration.mdx │ │ │ │ ├── frontmatter.md │ │ │ │ ├── icons.mdx │ │ │ │ ├── overrides.md │ │ │ │ ├── plugins.md │ │ │ │ └── route-data.mdx │ │ │ └── resources │ │ │ │ ├── community-content.mdx │ │ │ │ ├── plugins.mdx │ │ │ │ ├── showcase.mdx │ │ │ │ └── themes.mdx │ │ ├── fr │ │ │ ├── 404.md │ │ │ ├── components │ │ │ │ ├── asides.mdx │ │ │ │ ├── badges.mdx │ │ │ │ ├── card-grids.mdx │ │ │ │ ├── cards.mdx │ │ │ │ ├── code.mdx │ │ │ │ ├── file-tree.mdx │ │ │ │ ├── icons.mdx │ │ │ │ ├── link-buttons.mdx │ │ │ │ ├── link-cards.mdx │ │ │ │ ├── steps.mdx │ │ │ │ ├── tabs.mdx │ │ │ │ └── using-components.mdx │ │ │ ├── environmental-impact.md │ │ │ ├── getting-started.mdx │ │ │ ├── guides │ │ │ │ ├── authoring-content.mdx │ │ │ │ ├── css-and-tailwind.mdx │ │ │ │ ├── customization.mdx │ │ │ │ ├── i18n.mdx │ │ │ │ ├── overriding-components.mdx │ │ │ │ ├── pages.mdx │ │ │ │ ├── project-structure.mdx │ │ │ │ ├── route-data.mdx │ │ │ │ ├── sidebar.mdx │ │ │ │ └── site-search.mdx │ │ │ ├── index.mdx │ │ │ ├── manual-setup.mdx │ │ │ ├── reference │ │ │ │ ├── configuration.mdx │ │ │ │ ├── frontmatter.md │ │ │ │ ├── icons.mdx │ │ │ │ ├── overrides.md │ │ │ │ ├── plugins.md │ │ │ │ └── route-data.mdx │ │ │ └── resources │ │ │ │ ├── community-content.mdx │ │ │ │ ├── plugins.mdx │ │ │ │ ├── showcase.mdx │ │ │ │ └── themes.mdx │ │ ├── getting-started.mdx │ │ ├── guides │ │ │ ├── authoring-content.mdx │ │ │ ├── css-and-tailwind.mdx │ │ │ ├── customization.mdx │ │ │ ├── i18n.mdx │ │ │ ├── overriding-components.mdx │ │ │ ├── pages.mdx │ │ │ ├── project-structure.mdx │ │ │ ├── route-data.mdx │ │ │ ├── sidebar.mdx │ │ │ └── site-search.mdx │ │ ├── hi │ │ │ ├── 404.md │ │ │ ├── environmental-impact.md │ │ │ ├── getting-started.mdx │ │ │ ├── guides │ │ │ │ ├── css-and-tailwind.mdx │ │ │ │ ├── customization.mdx │ │ │ │ ├── i18n.mdx │ │ │ │ ├── overriding-components.md │ │ │ │ ├── project-structure.mdx │ │ │ │ ├── sidebar.mdx │ │ │ │ └── site-search.mdx │ │ │ ├── index.mdx │ │ │ └── manual-setup.mdx │ │ ├── id │ │ │ ├── 404.md │ │ │ ├── environmental-impact.md │ │ │ ├── getting-started.mdx │ │ │ ├── guides │ │ │ │ ├── authoring-content.md │ │ │ │ ├── css-and-tailwind.mdx │ │ │ │ ├── customization.mdx │ │ │ │ ├── i18n.mdx │ │ │ │ ├── overriding-components.md │ │ │ │ ├── project-structure.mdx │ │ │ │ ├── sidebar.mdx │ │ │ │ └── site-search.mdx │ │ │ ├── index.mdx │ │ │ ├── manual-setup.mdx │ │ │ └── reference │ │ │ │ ├── configuration.mdx │ │ │ │ └── frontmatter.md │ │ ├── index.mdx │ │ ├── it │ │ │ ├── 404.md │ │ │ ├── environmental-impact.md │ │ │ ├── getting-started.mdx │ │ │ ├── guides │ │ │ │ ├── authoring-content.md │ │ │ │ ├── css-and-tailwind.mdx │ │ │ │ ├── customization.mdx │ │ │ │ ├── i18n.mdx │ │ │ │ ├── overriding-components.mdx │ │ │ │ ├── pages.mdx │ │ │ │ ├── project-structure.mdx │ │ │ │ ├── sidebar.mdx │ │ │ │ └── site-search.mdx │ │ │ ├── index.mdx │ │ │ ├── manual-setup.mdx │ │ │ ├── reference │ │ │ │ ├── configuration.mdx │ │ │ │ ├── frontmatter.md │ │ │ │ ├── overrides.md │ │ │ │ └── plugins.md │ │ │ └── resources │ │ │ │ ├── community-content.mdx │ │ │ │ ├── plugins.mdx │ │ │ │ └── showcase.mdx │ │ ├── ja │ │ │ ├── 404.md │ │ │ ├── components │ │ │ │ ├── asides.mdx │ │ │ │ ├── badges.mdx │ │ │ │ ├── card-grids.mdx │ │ │ │ ├── cards.mdx │ │ │ │ ├── code.mdx │ │ │ │ ├── file-tree.mdx │ │ │ │ ├── icons.mdx │ │ │ │ ├── link-buttons.mdx │ │ │ │ ├── link-cards.mdx │ │ │ │ ├── steps.mdx │ │ │ │ ├── tabs.mdx │ │ │ │ └── using-components.mdx │ │ │ ├── environmental-impact.md │ │ │ ├── getting-started.mdx │ │ │ ├── guides │ │ │ │ ├── authoring-content.mdx │ │ │ │ ├── css-and-tailwind.mdx │ │ │ │ ├── customization.mdx │ │ │ │ ├── i18n.mdx │ │ │ │ ├── overriding-components.mdx │ │ │ │ ├── pages.mdx │ │ │ │ ├── project-structure.mdx │ │ │ │ ├── sidebar.mdx │ │ │ │ └── site-search.mdx │ │ │ ├── index.mdx │ │ │ ├── manual-setup.mdx │ │ │ ├── reference │ │ │ │ ├── configuration.mdx │ │ │ │ ├── frontmatter.md │ │ │ │ ├── icons.mdx │ │ │ │ ├── overrides.md │ │ │ │ └── plugins.md │ │ │ └── resources │ │ │ │ ├── community-content.mdx │ │ │ │ ├── plugins.mdx │ │ │ │ └── showcase.mdx │ │ ├── ko │ │ │ ├── 404.md │ │ │ ├── components │ │ │ │ ├── asides.mdx │ │ │ │ ├── badges.mdx │ │ │ │ ├── card-grids.mdx │ │ │ │ ├── cards.mdx │ │ │ │ ├── code.mdx │ │ │ │ ├── file-tree.mdx │ │ │ │ ├── icons.mdx │ │ │ │ ├── link-buttons.mdx │ │ │ │ ├── link-cards.mdx │ │ │ │ ├── steps.mdx │ │ │ │ ├── tabs.mdx │ │ │ │ └── using-components.mdx │ │ │ ├── environmental-impact.md │ │ │ ├── getting-started.mdx │ │ │ ├── guides │ │ │ │ ├── authoring-content.mdx │ │ │ │ ├── css-and-tailwind.mdx │ │ │ │ ├── customization.mdx │ │ │ │ ├── i18n.mdx │ │ │ │ ├── overriding-components.mdx │ │ │ │ ├── pages.mdx │ │ │ │ ├── project-structure.mdx │ │ │ │ ├── route-data.mdx │ │ │ │ ├── sidebar.mdx │ │ │ │ └── site-search.mdx │ │ │ ├── index.mdx │ │ │ ├── manual-setup.mdx │ │ │ ├── reference │ │ │ │ ├── configuration.mdx │ │ │ │ ├── frontmatter.md │ │ │ │ ├── icons.mdx │ │ │ │ ├── overrides.md │ │ │ │ ├── plugins.md │ │ │ │ └── route-data.mdx │ │ │ └── resources │ │ │ │ ├── community-content.mdx │ │ │ │ ├── plugins.mdx │ │ │ │ ├── showcase.mdx │ │ │ │ └── themes.mdx │ │ ├── manual-setup.mdx │ │ ├── pt-br │ │ │ ├── 404.md │ │ │ ├── environmental-impact.md │ │ │ ├── getting-started.mdx │ │ │ ├── guides │ │ │ │ ├── authoring-content.md │ │ │ │ ├── css-and-tailwind.mdx │ │ │ │ ├── customization.mdx │ │ │ │ ├── i18n.mdx │ │ │ │ ├── overriding-components.md │ │ │ │ ├── pages.mdx │ │ │ │ ├── project-structure.mdx │ │ │ │ ├── sidebar.mdx │ │ │ │ └── site-search.mdx │ │ │ ├── index.mdx │ │ │ ├── manual-setup.mdx │ │ │ ├── reference │ │ │ │ ├── configuration.mdx │ │ │ │ ├── frontmatter.md │ │ │ │ ├── overrides.md │ │ │ │ └── plugins.md │ │ │ └── resources │ │ │ │ ├── community-content.mdx │ │ │ │ ├── plugins.mdx │ │ │ │ └── showcase.mdx │ │ ├── pt-pt │ │ │ ├── 404.md │ │ │ ├── environmental-impact.md │ │ │ ├── getting-started.mdx │ │ │ ├── index.mdx │ │ │ ├── manual-setup.mdx │ │ │ └── resources │ │ │ │ ├── community-content.mdx │ │ │ │ ├── plugins.mdx │ │ │ │ └── showcase.mdx │ │ ├── reference │ │ │ ├── configuration.mdx │ │ │ ├── frontmatter.md │ │ │ ├── icons.mdx │ │ │ ├── overrides.md │ │ │ ├── plugins.md │ │ │ └── route-data.mdx │ │ ├── resources │ │ │ ├── community-content.mdx │ │ │ ├── plugins.mdx │ │ │ ├── showcase.mdx │ │ │ └── themes.mdx │ │ ├── ru │ │ │ ├── 404.md │ │ │ ├── components │ │ │ │ ├── asides.mdx │ │ │ │ ├── badges.mdx │ │ │ │ ├── card-grids.mdx │ │ │ │ ├── cards.mdx │ │ │ │ ├── code.mdx │ │ │ │ ├── file-tree.mdx │ │ │ │ ├── icons.mdx │ │ │ │ ├── link-buttons.mdx │ │ │ │ ├── link-cards.mdx │ │ │ │ ├── steps.mdx │ │ │ │ ├── tabs.mdx │ │ │ │ └── using-components.mdx │ │ │ ├── environmental-impact.md │ │ │ ├── getting-started.mdx │ │ │ ├── guides │ │ │ │ ├── authoring-content.mdx │ │ │ │ ├── css-and-tailwind.mdx │ │ │ │ ├── customization.mdx │ │ │ │ ├── i18n.mdx │ │ │ │ ├── overriding-components.mdx │ │ │ │ ├── pages.mdx │ │ │ │ ├── project-structure.mdx │ │ │ │ ├── route-data.mdx │ │ │ │ ├── sidebar.mdx │ │ │ │ └── site-search.mdx │ │ │ ├── index.mdx │ │ │ ├── manual-setup.mdx │ │ │ ├── reference │ │ │ │ ├── configuration.mdx │ │ │ │ ├── frontmatter.md │ │ │ │ ├── icons.mdx │ │ │ │ ├── overrides.md │ │ │ │ ├── plugins.md │ │ │ │ └── route-data.mdx │ │ │ └── resources │ │ │ │ ├── community-content.mdx │ │ │ │ ├── plugins.mdx │ │ │ │ ├── showcase.mdx │ │ │ │ └── themes.mdx │ │ ├── tr │ │ │ ├── 404.md │ │ │ ├── environmental-impact.md │ │ │ ├── getting-started.mdx │ │ │ ├── guides │ │ │ │ ├── authoring-content.md │ │ │ │ ├── css-and-tailwind.mdx │ │ │ │ ├── customization.mdx │ │ │ │ ├── project-structure.mdx │ │ │ │ └── sidebar.mdx │ │ │ ├── index.mdx │ │ │ ├── manual-setup.mdx │ │ │ └── resources │ │ │ │ ├── community-content.mdx │ │ │ │ └── showcase.mdx │ │ ├── uk │ │ │ ├── 404.md │ │ │ ├── getting-started.mdx │ │ │ ├── index.mdx │ │ │ └── manual-setup.mdx │ │ └── zh-cn │ │ │ ├── 404.md │ │ │ ├── components │ │ │ ├── asides.mdx │ │ │ ├── badges.mdx │ │ │ ├── card-grids.mdx │ │ │ ├── cards.mdx │ │ │ ├── code.mdx │ │ │ ├── file-tree.mdx │ │ │ ├── icons.mdx │ │ │ ├── link-buttons.mdx │ │ │ ├── link-cards.mdx │ │ │ ├── steps.mdx │ │ │ ├── tabs.mdx │ │ │ └── using-components.mdx │ │ │ ├── environmental-impact.md │ │ │ ├── getting-started.mdx │ │ │ ├── guides │ │ │ ├── authoring-content.mdx │ │ │ ├── css-and-tailwind.mdx │ │ │ ├── customization.mdx │ │ │ ├── i18n.mdx │ │ │ ├── overriding-components.mdx │ │ │ ├── pages.mdx │ │ │ ├── project-structure.mdx │ │ │ ├── route-data.mdx │ │ │ ├── sidebar.mdx │ │ │ └── site-search.mdx │ │ │ ├── index.mdx │ │ │ ├── manual-setup.mdx │ │ │ ├── reference │ │ │ ├── configuration.mdx │ │ │ ├── frontmatter.md │ │ │ ├── icons.mdx │ │ │ ├── overrides.md │ │ │ ├── plugins.md │ │ │ └── route-data.mdx │ │ │ └── resources │ │ │ ├── community-content.mdx │ │ │ ├── plugins.mdx │ │ │ ├── showcase.mdx │ │ │ └── themes.mdx │ │ └── i18n │ │ ├── de.json │ │ ├── en.json │ │ ├── fr.json │ │ ├── ja.json │ │ ├── ko.json │ │ ├── ru.json │ │ └── zh-CN.json └── tsconfig.json ├── examples ├── basics │ ├── .gitignore │ ├── .vscode │ │ ├── extensions.json │ │ └── launch.json │ ├── README.md │ ├── astro.config.mjs │ ├── package.json │ ├── public │ │ └── favicon.svg │ ├── src │ │ ├── assets │ │ │ └── houston.webp │ │ ├── content.config.ts │ │ └── content │ │ │ └── docs │ │ │ ├── guides │ │ │ └── example.md │ │ │ ├── index.mdx │ │ │ └── reference │ │ │ └── example.md │ └── tsconfig.json ├── markdoc │ ├── .gitignore │ ├── .vscode │ │ ├── extensions.json │ │ └── launch.json │ ├── README.md │ ├── astro.config.mjs │ ├── markdoc.config.mjs │ ├── package.json │ ├── public │ │ └── favicon.svg │ ├── src │ │ ├── assets │ │ │ └── houston.webp │ │ ├── content.config.ts │ │ └── content │ │ │ └── docs │ │ │ ├── guides │ │ │ └── example.mdoc │ │ │ ├── index.mdoc │ │ │ └── reference │ │ │ └── example.mdoc │ └── tsconfig.json └── tailwind │ ├── .gitignore │ ├── .vscode │ ├── extensions.json │ └── launch.json │ ├── README.md │ ├── astro.config.mjs │ ├── package.json │ ├── public │ └── favicon.svg │ ├── src │ ├── assets │ │ └── houston.webp │ ├── content.config.ts │ ├── content │ │ └── docs │ │ │ ├── guides │ │ │ └── example.md │ │ │ ├── index.mdx │ │ │ └── reference │ │ │ └── example.md │ └── styles │ │ └── global.css │ └── tsconfig.json ├── package.json ├── packages ├── docsearch │ ├── CHANGELOG.md │ ├── DocSearch.astro │ ├── README.md │ ├── index.ts │ ├── package.json │ ├── schema.ts │ ├── variables.css │ └── virtual.d.ts ├── file-icons-generator │ ├── config.ts │ ├── index.ts │ ├── package.json │ └── utils │ │ ├── file.ts │ │ ├── font.ts │ │ └── seti.ts ├── markdoc │ ├── .npmignore │ ├── CHANGELOG.md │ ├── Code.astro │ ├── README.md │ ├── __tests__ │ │ └── markdoc.test-d.ts │ ├── components.ts │ ├── html.mjs │ ├── index.mjs │ └── package.json ├── starlight │ ├── .gitignore │ ├── .npmignore │ ├── CHANGELOG.md │ ├── README.md │ ├── __e2e__ │ │ ├── .gitignore │ │ ├── collection-config.test.ts │ │ ├── components.test.ts │ │ ├── fixtures │ │ │ ├── basics │ │ │ │ ├── astro.config.mjs │ │ │ │ ├── package.json │ │ │ │ └── src │ │ │ │ │ ├── components │ │ │ │ │ ├── PurpleCard.astro │ │ │ │ │ └── Test.astro │ │ │ │ │ ├── content.config.ts │ │ │ │ │ ├── content │ │ │ │ │ ├── docs │ │ │ │ │ │ ├── anchor-heading-component.mdx │ │ │ │ │ │ ├── anchor-heading.md │ │ │ │ │ │ ├── head-propagation.mdx │ │ │ │ │ │ ├── tabs-nested.mdx │ │ │ │ │ │ ├── tabs-unsynced.mdx │ │ │ │ │ │ ├── tabs-variable-height.mdx │ │ │ │ │ │ ├── tabs.mdx │ │ │ │ │ │ └── whitespaces.mdx │ │ │ │ │ └── reviews │ │ │ │ │ │ └── alice.mdx │ │ │ │ │ ├── env.d.ts │ │ │ │ │ └── pages │ │ │ │ │ ├── [...param].astro │ │ │ │ │ ├── markdown-page.md │ │ │ │ │ └── reviews │ │ │ │ │ └── [...review].astro │ │ │ ├── custom src-dir │ │ │ │ ├── astro.config.mjs │ │ │ │ ├── package.json │ │ │ │ └── www │ │ │ │ │ ├── content.config.ts │ │ │ │ │ ├── env.d.ts │ │ │ │ │ └── pages │ │ │ │ │ └── custom.astro │ │ │ ├── git │ │ │ │ ├── .gitignore │ │ │ │ ├── astro.config.mjs │ │ │ │ ├── package.json │ │ │ │ └── src │ │ │ │ │ ├── content.config.ts │ │ │ │ │ └── content │ │ │ │ │ └── docs │ │ │ │ │ └── index.md │ │ │ ├── legacy-collection-config-file │ │ │ │ ├── astro.config.mjs │ │ │ │ ├── package.json │ │ │ │ └── src │ │ │ │ │ ├── content │ │ │ │ │ └── config.ts │ │ │ │ │ └── pages │ │ │ │ │ └── custom.astro │ │ │ └── ssr │ │ │ │ ├── astro.config.mjs │ │ │ │ ├── package.json │ │ │ │ └── src │ │ │ │ ├── component │ │ │ │ └── ServerCheck.astro │ │ │ │ ├── content.config.ts │ │ │ │ ├── content │ │ │ │ └── docs │ │ │ │ │ ├── 404.mdx │ │ │ │ │ ├── content.mdx │ │ │ │ │ ├── demo.mdx │ │ │ │ │ └── index.md │ │ │ │ └── middleware.ts │ │ ├── git.test.ts │ │ ├── legacy-collection-config-file.test.ts │ │ ├── ssr.test.ts │ │ └── test-utils.ts │ ├── __tests__ │ │ ├── basics │ │ │ ├── base.test.ts │ │ │ ├── config-errors.test.ts │ │ │ ├── config.test.ts │ │ │ ├── format-canonical.test.ts │ │ │ ├── format-path.test.ts │ │ │ ├── git.test.ts │ │ │ ├── i18n.test.ts │ │ │ ├── localizedUrl.test.ts │ │ │ ├── navigation-labels.test.ts │ │ │ ├── navigation-order.test.ts │ │ │ ├── navigation.test.ts │ │ │ ├── pagination-with-base.test.ts │ │ │ ├── route-data.test.ts │ │ │ ├── routing.test.ts │ │ │ ├── schema.test.ts │ │ │ ├── sitemap.test.ts │ │ │ ├── slugs.test.ts │ │ │ ├── sorting.test.ts │ │ │ ├── starlight-page-route-data-extend.test.ts │ │ │ ├── starlight-page-route-data.test.ts │ │ │ ├── toc.test.ts │ │ │ ├── translations.test.ts │ │ │ ├── user-config.test.ts │ │ │ └── vitest.config.ts │ │ ├── build-format-file │ │ │ ├── navigation.test.ts │ │ │ └── vitest.config.ts │ │ ├── edit-url │ │ │ ├── edit-url.test.ts │ │ │ └── vitest.config.ts │ │ ├── git-utils.ts │ │ ├── head │ │ │ ├── head.test.ts │ │ │ └── vitest.config.ts │ │ ├── i18n-non-root-single-locale │ │ │ ├── config.test.ts │ │ │ ├── i18n.test.ts │ │ │ ├── localizedUrl.test.ts │ │ │ ├── routing.test.ts │ │ │ ├── slugs.test.ts │ │ │ ├── src │ │ │ │ └── content │ │ │ │ │ └── i18n │ │ │ │ │ └── fr.json │ │ │ ├── translations-fs.test.ts │ │ │ ├── translations-with-user-config.test.ts │ │ │ ├── translations.test.ts │ │ │ └── vitest.config.ts │ │ ├── i18n-root-locale │ │ │ ├── config.test.ts │ │ │ ├── i18n.test.ts │ │ │ ├── localizedUrl.test.ts │ │ │ ├── routing.test.ts │ │ │ ├── slugs.test.ts │ │ │ └── vitest.config.ts │ │ ├── i18n-sidebar-badge-error │ │ │ ├── i18n-sidebar-badge-error.test.ts │ │ │ └── vitest.config.ts │ │ ├── i18n-sidebar │ │ │ ├── i18n-sidebar-fallback-slug.test.ts │ │ │ ├── i18n-sidebar.test.ts │ │ │ ├── sidebar-internal-link-error.test.ts │ │ │ └── vitest.config.ts │ │ ├── i18n-single-root-locale │ │ │ ├── config.test.ts │ │ │ ├── i18n.test.ts │ │ │ ├── routing.test.ts │ │ │ ├── slugs.test.ts │ │ │ ├── src │ │ │ │ └── content │ │ │ │ │ └── i18n │ │ │ │ │ └── fr.json │ │ │ ├── translations-fs.test.ts │ │ │ ├── translations-with-user-config.test.ts │ │ │ ├── translations.test.ts │ │ │ └── vitest.config.ts │ │ ├── i18n │ │ │ ├── config.test.ts │ │ │ ├── empty-src │ │ │ │ └── content │ │ │ │ │ └── i18n │ │ │ │ │ └── .gitkeep │ │ │ ├── head.test.ts │ │ │ ├── i18n.test.ts │ │ │ ├── localizedUrl.test.ts │ │ │ ├── malformed-json-src │ │ │ │ └── content │ │ │ │ │ └── i18n │ │ │ │ │ └── en.json │ │ │ ├── malformed-yaml-src │ │ │ │ └── content │ │ │ │ │ └── i18n │ │ │ │ │ └── en.yml │ │ │ ├── navigation-order.test.ts │ │ │ ├── routing.test.ts │ │ │ ├── src │ │ │ │ └── content │ │ │ │ │ └── i18n │ │ │ │ │ ├── en.json │ │ │ │ │ └── fr.yml │ │ │ ├── translations-ec.test.ts │ │ │ ├── translations-fs.test.ts │ │ │ ├── translations-with-user-config.test.ts │ │ │ ├── translations.test.ts │ │ │ └── vitest.config.ts │ │ ├── middleware │ │ │ ├── middleware.test.ts │ │ │ └── vitest.config.ts │ │ ├── plugins │ │ │ ├── config.test.ts │ │ │ ├── integration.test.ts │ │ │ ├── route-middleware.test.ts │ │ │ ├── translations.test.ts │ │ │ └── vitest.config.ts │ │ ├── remark-rehype │ │ │ ├── anchor-links.test.ts │ │ │ ├── asides.test.ts │ │ │ ├── code-rtl-support.test.ts │ │ │ ├── rehype-file-tree.test.ts │ │ │ ├── rehype-steps.test.ts │ │ │ ├── rehype-tabs.test.ts │ │ │ ├── snapshots │ │ │ │ ├── file-tree-basic.html │ │ │ │ ├── file-tree-comment-nodes.html │ │ │ │ ├── file-tree-comment-text.html │ │ │ │ ├── generates-anchor-link-markup.html │ │ │ │ ├── generates-aside.html │ │ │ │ ├── handles-complex-children.html │ │ │ │ ├── nested-asides-custom-titles.html │ │ │ │ └── nested-asides.html │ │ │ └── vitest.config.ts │ │ ├── sidebar-slug-error │ │ │ ├── sidebar-slug-error.test.ts │ │ │ └── vitest.config.ts │ │ ├── sidebar │ │ │ ├── navigation-attributes.test.ts │ │ │ ├── navigation-badges.test.ts │ │ │ ├── navigation-hidden.test.ts │ │ │ ├── navigation-order.test.ts │ │ │ ├── navigation-unicode.test.ts │ │ │ ├── navigation.test.ts │ │ │ └── vitest.config.ts │ │ ├── snapshot-serializer-astro-error.ts │ │ ├── test-config.ts │ │ ├── test-plugin-utils.ts │ │ └── test-utils.ts │ ├── components.ts │ ├── components │ │ ├── AnchorHeading.astro │ │ ├── Banner.astro │ │ ├── ContentNotice.astro │ │ ├── ContentPanel.astro │ │ ├── DraftContentNotice.astro │ │ ├── EditLink.astro │ │ ├── FallbackContentNotice.astro │ │ ├── Footer.astro │ │ ├── Head.astro │ │ ├── Header.astro │ │ ├── Hero.astro │ │ ├── Icons.ts │ │ ├── LanguageSelect.astro │ │ ├── LastUpdated.astro │ │ ├── MarkdownContent.astro │ │ ├── MobileMenuFooter.astro │ │ ├── MobileMenuToggle.astro │ │ ├── MobileTableOfContents.astro │ │ ├── Page.astro │ │ ├── PageFrame.astro │ │ ├── PageSidebar.astro │ │ ├── PageTitle.astro │ │ ├── Pagination.astro │ │ ├── Search.astro │ │ ├── Select.astro │ │ ├── Sidebar.astro │ │ ├── SidebarPersistState.ts │ │ ├── SidebarPersister.astro │ │ ├── SidebarRestorePoint.astro │ │ ├── SidebarSublist.astro │ │ ├── SiteTitle.astro │ │ ├── SkipLink.astro │ │ ├── SocialIcons.astro │ │ ├── StarlightPage.astro │ │ ├── TableOfContents.astro │ │ ├── TableOfContents │ │ │ ├── TableOfContentsList.astro │ │ │ └── starlight-toc.ts │ │ ├── ThemeProvider.astro │ │ ├── ThemeSelect.astro │ │ └── TwoColumnContent.astro │ ├── constants.ts │ ├── expressive-code.d.ts │ ├── expressive-code.mjs │ ├── global.d.ts │ ├── i18n.d.ts │ ├── index.ts │ ├── integrations │ │ ├── asides.ts │ │ ├── code-rtl-support.ts │ │ ├── expressive-code │ │ │ ├── hast.d.ts │ │ │ ├── hast.mjs │ │ │ ├── index.ts │ │ │ ├── themes │ │ │ │ ├── night-owl-dark.jsonc │ │ │ │ └── night-owl-light.jsonc │ │ │ ├── theming.ts │ │ │ └── translations.ts │ │ ├── heading-links.ts │ │ ├── shared │ │ │ ├── absolutePathToLang.ts │ │ │ ├── localeToLang.ts │ │ │ └── slugToLocale.ts │ │ ├── sitemap.ts │ │ └── virtual-user-config.ts │ ├── internal.ts │ ├── loaders.ts │ ├── locals.d.ts │ ├── locals.ts │ ├── package.json │ ├── playwright.config.ts │ ├── props.ts │ ├── route-data.ts │ ├── routes │ │ ├── common.astro │ │ ├── ssr │ │ │ ├── 404.astro │ │ │ └── index.astro │ │ └── static │ │ │ ├── 404.astro │ │ │ └── index.astro │ ├── schema.ts │ ├── schemas │ │ ├── badge.ts │ │ ├── components.ts │ │ ├── expressiveCode.ts │ │ ├── favicon.ts │ │ ├── head.ts │ │ ├── hero.ts │ │ ├── i18n.ts │ │ ├── icon.ts │ │ ├── logo.ts │ │ ├── pagefind.ts │ │ ├── prevNextLink.ts │ │ ├── sidebar.ts │ │ ├── site-title.ts │ │ ├── social.ts │ │ └── tableOfContents.ts │ ├── style │ │ ├── anchor-links.css │ │ ├── asides.css │ │ ├── layers.css │ │ ├── markdown.css │ │ ├── print.css │ │ ├── props.css │ │ ├── reset.css │ │ └── util.css │ ├── translations │ │ ├── README.md │ │ ├── ar.json │ │ ├── ca.json │ │ ├── cs.json │ │ ├── da.json │ │ ├── de.json │ │ ├── en.json │ │ ├── es.json │ │ ├── fa.json │ │ ├── fr.json │ │ ├── gl.json │ │ ├── he.json │ │ ├── hi.json │ │ ├── hu.json │ │ ├── id.json │ │ ├── index.ts │ │ ├── it.json │ │ ├── ja.json │ │ ├── ko.json │ │ ├── lv.json │ │ ├── nb.json │ │ ├── nl.json │ │ ├── pl.json │ │ ├── pt.json │ │ ├── ro.json │ │ ├── ru.json │ │ ├── sk.json │ │ ├── sv.json │ │ ├── tr.json │ │ ├── uk.json │ │ ├── vi.json │ │ ├── zh-CN.json │ │ └── zh-TW.json │ ├── types.ts │ ├── user-components │ │ ├── Aside.astro │ │ ├── Badge.astro │ │ ├── Card.astro │ │ ├── CardGrid.astro │ │ ├── FileTree.astro │ │ ├── Icon.astro │ │ ├── LinkButton.astro │ │ ├── LinkCard.astro │ │ ├── Steps.astro │ │ ├── TabItem.astro │ │ ├── Tabs.astro │ │ ├── file-tree-icons.ts │ │ ├── rehype-file-tree.ts │ │ ├── rehype-steps.ts │ │ └── rehype-tabs.ts │ ├── utils │ │ ├── base.ts │ │ ├── canonical.ts │ │ ├── collection.ts │ │ ├── createPathFormatter.ts │ │ ├── createTranslationSystem.ts │ │ ├── error-map.ts │ │ ├── format-path.ts │ │ ├── generateToC.ts │ │ ├── git.ts │ │ ├── gitInlined.ts │ │ ├── head.ts │ │ ├── i18n.ts │ │ ├── localizedUrl.ts │ │ ├── navigation.ts │ │ ├── path.ts │ │ ├── plugins.ts │ │ ├── routing │ │ │ ├── data.ts │ │ │ ├── index.ts │ │ │ ├── middleware.ts │ │ │ └── types.ts │ │ ├── slugs.ts │ │ ├── starlight-page.ts │ │ ├── translations-fs.ts │ │ ├── translations.ts │ │ ├── types.ts │ │ ├── user-config.ts │ │ └── validateLogoImports.ts │ ├── virtual-internal.d.ts │ ├── virtual.d.ts │ ├── vitest.config.ts │ └── vitest.workspace.ts └── tailwind │ ├── CHANGELOG.md │ ├── README.md │ ├── __tests__ │ └── tailwind.test.ts │ ├── package.json │ ├── tailwind.css │ └── vitest.config.ts ├── pnpm-lock.yaml ├── pnpm-workspace.yaml └── tsconfig.json /.changeset/README.md: -------------------------------------------------------------------------------- 1 | # Changesets 2 | 3 | Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works 4 | with multi-package repos, or single-package repos to help you version and publish your code. You can 5 | find the full documentation for it [in our repository](https://github.com/changesets/changesets) 6 | 7 | We have a quick list of common questions to get you started engaging with this project in 8 | [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) 9 | -------------------------------------------------------------------------------- /.changeset/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json", 3 | "changelog": [ 4 | "@changesets/changelog-github", 5 | { "repo": "withastro/starlight" } 6 | ], 7 | "commit": false, 8 | "linked": [], 9 | "access": "public", 10 | "baseBranch": "main", 11 | "updateInternalDependencies": "patch", 12 | "ignore": ["starlight-docs", "@example/*", "starlight-file-icons-generator", "@e2e/*"], 13 | "___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": { 14 | "onlyUpdatePeerDependentsWhenOutOfRange": true 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | # Based on https://github.com/withastro/astro/blob/main/.devcontainer/Dockerfile 2 | FROM mcr.microsoft.com/devcontainers/javascript-node:0-18 3 | 4 | # We uninstall pnpm here, since we enable the corepack version in the postCreateCommand 5 | # This ensures we respect the "packageManager" version in package.json 6 | RUN npm uninstall -g pnpm 7 | 8 | COPY welcome-message.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Contribute to Starlight", 3 | "build": { 4 | "dockerfile": "Dockerfile" 5 | }, 6 | "postCreateCommand": "sudo corepack enable pnpm && pnpm config set store-dir /home/node/.pnpm-store && PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 pnpm install", 7 | "waitFor": "postCreateCommand", 8 | "customizations": { 9 | "codespaces": { 10 | "openFiles": ["CONTRIBUTING.md"] 11 | }, 12 | "vscode": { 13 | "extensions": ["astro-build.astro-vscode", "esbenp.prettier-vscode"] 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.devcontainer/welcome-message.txt: -------------------------------------------------------------------------------- 1 | 🌟 Welcome to Starlight! 2 | 3 | 🛠️ Your environment is fully setup with all required software installed. 4 | 5 | Next steps: 6 | 7 | - Preview the docs site: 8 | cd docs && pnpm dev --host 9 | 10 | - Run tests: 11 | cd packages/starlight && pnpm test 12 | -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # Apply with: 2 | # `git config --local blame.ignoreRevsFile .git-blame-ignore-revs` 3 | 4 | # [Add Prettier and format files](https://github.com/withastro/starlight/pull/393) 5 | 9b172f5ee09697d80f301e9b70aca1946419ce24 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: 💡 Feature Request 4 | url: https://github.com/withastro/starlight/discussions/new?category=feature-requests 5 | about: Suggest an improvement you’d like to see added to Starlight 6 | - name: 👾 Chat 7 | url: https://astro.build/chat 8 | about: Our Discord server is active, come join us! 9 | - name: 💁 Support 10 | url: https://astro.build/chat 11 | about: 'This issue tracker is not for support questions. Join us on Discord for assistance!' 12 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | #### Description 4 | 5 | - Closes # 6 | - What does this PR change? Give us a brief description. 7 | - Did you change something visual? A before/after screenshot can be helpful. 8 | 9 | 14 | -------------------------------------------------------------------------------- /.github/renovate.json5: -------------------------------------------------------------------------------- 1 | { 2 | $schema: 'https://docs.renovatebot.com/renovate-schema.json', 3 | extends: [ 4 | ':disableDependencyDashboard', 5 | ':semanticPrefixFixDepsChoreOthers', 6 | ':ignoreModulesAndTests', 7 | 'workarounds:all', 8 | 'helpers:pinGitHubActionDigestsToSemver', 9 | 'docker:disable', 10 | ], 11 | rangeStrategy: 'bump', 12 | ignorePaths: ['**/node_modules/**'], 13 | packageRules: [ 14 | { 15 | groupName: 'github-actions', 16 | matchManagers: ['github-actions'], 17 | }, 18 | { 19 | matchManagers: ['npm'], 20 | groupName: 'dependencies', 21 | matchDepTypes: ['devDependencies', 'dependencies', 'peerDependencies'], 22 | enabled: false, 23 | }, 24 | { 25 | description: 'Disable package manager version updates', 26 | matchPackageNames: ['pnpm'], 27 | matchDepTypes: ['packageManager'], 28 | enabled: false, 29 | }, 30 | ], 31 | } 32 | -------------------------------------------------------------------------------- /.github/workflows/congratsbot.yml: -------------------------------------------------------------------------------- 1 | name: Congratsbot 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | 7 | jobs: 8 | congrats: 9 | if: ${{ github.repository_owner == 'withastro' && github.event.head_commit.message != '[ci] format' }} 10 | uses: withastro/automation/.github/workflows/congratsbot.yml@main 11 | with: 12 | EMOJIS: '🎉,🎊,🧑‍🚀,🥳,🙌,🚀,🤩,☄️,💫,<:starlight:1107431075543797802>,<:houston_pride:1130504824673284107>' 13 | COAUTHOR_TEMPLATES: > 14 | [ 15 | "Thanks for helping! ✨", 16 | " stepped up to lend a hand — thank you! 🙌", 17 | " with the assist! 💪", 18 | "Couldn’t have done this without ! 💖", 19 | "Made even better by ! 🚀", 20 | "And the team effort award goes to… ! 🏆", 21 | "Featuring contributions by ! 🌟" 22 | ] 23 | secrets: 24 | DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_CONGRATS }} 25 | -------------------------------------------------------------------------------- /.github/workflows/format.yml: -------------------------------------------------------------------------------- 1 | name: Format 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | jobs: 9 | format: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Check out code using Git 13 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 14 | with: 15 | ref: ${{ github.head_ref }} 16 | # Needs access to push to main 17 | token: ${{ secrets.FREDKBOT_GITHUB_TOKEN }} 18 | - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 19 | - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 20 | with: 21 | node-version: 18 22 | cache: 'pnpm' 23 | - run: pnpm i 24 | - name: Format with Prettier 25 | run: pnpm format 26 | - name: Commit changes 27 | uses: stefanzweifel/git-auto-commit-action@b863ae1933cb653a53c021fe36dbb774e1fb9403 # v5.2.0 28 | with: 29 | commit_message: '[ci] format' 30 | branch: ${{ github.head_ref }} 31 | commit_user_name: fredkbot 32 | commit_user_email: fred+astrobot@astro.build 33 | -------------------------------------------------------------------------------- /.github/workflows/pr-labeler.yml: -------------------------------------------------------------------------------- 1 | name: 'Pull Request Labeler' 2 | on: 3 | - pull_request_target 4 | 5 | jobs: 6 | triage: 7 | permissions: 8 | contents: read 9 | pull-requests: write 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0 13 | with: 14 | repo-token: '${{ secrets.GITHUB_TOKEN }}' 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # dependencies 2 | node_modules/ 3 | 4 | # logs 5 | npm-debug.log* 6 | yarn-debug.log* 7 | yarn-error.log* 8 | pnpm-debug.log* 9 | 10 | # environment variables 11 | .env 12 | .env.production 13 | 14 | # macOS-specific files 15 | .DS_Store 16 | 17 | # Vitest 18 | __coverage__/ 19 | 20 | # Playwright 21 | test-results/ 22 | 23 | # Vercel output 24 | .vercel 25 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | prefer-workspace-packages=true 2 | link-workspace-packages=true 3 | shell-emulator=true 4 | auto-install-peers=false 5 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # Deep Directories 2 | **/node_modules 3 | 4 | # Generated Directories 5 | **/dist 6 | **/build 7 | **/.astro 8 | **/__coverage__ 9 | 10 | # Directories 11 | .changeset 12 | 13 | # Files 14 | pnpm-lock.yaml 15 | 16 | # Test snapshots 17 | **/__tests__/**/snapshots 18 | 19 | # https://github.com/withastro/prettier-plugin-astro/issues/337 20 | packages/starlight/user-components/Tabs.astro 21 | 22 | # Prettier forces whitespace between elements we want to avoid for consistency with the rehype version 23 | packages/starlight/components/AnchorHeading.astro 24 | packages/starlight/__e2e__/fixtures/basics/src/content/docs/anchor-heading-component.mdx 25 | 26 | # Malformed YAML file used for testing 27 | packages/starlight/__tests__/i18n/malformed-yaml-src/content/i18n/*.yml 28 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 100, 3 | "semi": true, 4 | "singleQuote": true, 5 | "tabWidth": 2, 6 | "trailingComma": "es5", 7 | "useTabs": true, 8 | "plugins": ["prettier-plugin-astro"], 9 | "overrides": [ 10 | { 11 | "files": [".*", "*.json", "*.md", "*.toml", "*.yml"], 12 | "options": { 13 | "useTabs": false 14 | } 15 | }, 16 | { 17 | "files": ["*.md", "*.mdx"], 18 | "options": { 19 | "printWidth": 80 20 | } 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["astro-build.astro-vscode"], 3 | "unwantedRecommendations": [] 4 | } 5 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "command": "./node_modules/.bin/astro dev", 6 | "cwd": "${workspaceFolder}/docs", 7 | "name": "Development server", 8 | "request": "launch", 9 | "type": "node-terminal" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 [Astro contributors](https://github.com/withastro/starlight/graphs/contributors) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | packages/starlight/README.md -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | # build output 2 | dist/ 3 | # generated types 4 | .astro/ 5 | 6 | # dependencies 7 | node_modules/ 8 | 9 | # logs 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | pnpm-debug.log* 14 | 15 | 16 | # environment variables 17 | .env 18 | .env.production 19 | 20 | # macOS-specific files 21 | .DS_Store 22 | -------------------------------------------------------------------------------- /docs/.pa11yci: -------------------------------------------------------------------------------- 1 | { 2 | "defaults": { 3 | "runners": [ 4 | "axe" 5 | ], 6 | "ignore": [ 7 | "color-contrast" 8 | ] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /docs/__a11y__/docs.test.ts: -------------------------------------------------------------------------------- 1 | import { expect, test } from './test-utils'; 2 | 3 | test('does not report accessibility violations on the docs site', async ({ docsSite }) => { 4 | let violationsCount = 0; 5 | 6 | const urls = await docsSite.getAllUrls(); 7 | 8 | for (const url of urls) { 9 | const violations = await docsSite.testPage(url); 10 | 11 | if (violations.length > 0) { 12 | violationsCount += violations.length; 13 | } 14 | 15 | await docsSite.reportPageViolations(violations); 16 | } 17 | 18 | expect( 19 | violationsCount, 20 | `Found ${violationsCount} accessibility violations. Check the errors above for more details.` 21 | ).toBe(0); 22 | }); 23 | -------------------------------------------------------------------------------- /docs/grammars/README.md: -------------------------------------------------------------------------------- 1 | # Starlight Docs Grammars 2 | 3 | This directory contains additional grammars for the Starlight documentation website. 4 | 5 | ## Grammars 6 | 7 | The following additional grammars are generated and available for use: 8 | 9 | - [Markdoc](https://github.com/markdoc/language-server) 10 | 11 | ## Usage 12 | 13 | To generate the grammars from their source files, run: 14 | 15 | ```sh 16 | pnpm grammars 17 | ``` 18 | 19 | To include the grammars in the Starlight documentation website, update the `expressiveCode.shiki.langs` array in the `astro.config.mjs` file: 20 | 21 | ```diff 22 | starlight({ 23 | expressiveCode: { 24 | shiki: { 25 | langs: [ 26 | JSON.parse( 27 | fs.readFileSync('./grammars/existing.tmLanguage.json', 'utf-8'), 28 | + fs.readFileSync('./grammars/new.tmLanguage.json', 'utf-8'), 29 | ), 30 | ], 31 | }, 32 | }, 33 | }); 34 | ``` 35 | -------------------------------------------------------------------------------- /docs/lunaria/components.ts: -------------------------------------------------------------------------------- 1 | import { html } from '@lunariajs/core'; 2 | 3 | export const TitleParagraph = () => html` 4 |

5 | If you're interested in helping us translate 6 | starlight.astro.build into one of the languages 7 | listed below, you've come to the right place! This auto-updating page always lists all the 8 | content that could use your help right now. 9 |

10 |

11 | Before starting a new translation, please read our 12 | translation guide 16 | to learn about our translation process and how you can get involved. 17 |

18 | `; 19 | -------------------------------------------------------------------------------- /docs/lunaria/renderer.config.ts: -------------------------------------------------------------------------------- 1 | import { defineRendererConfig } from '@lunariajs/core'; 2 | import { TitleParagraph } from './components'; 3 | 4 | export default defineRendererConfig({ 5 | slots: { 6 | afterTitle: TitleParagraph, 7 | }, 8 | }); 9 | -------------------------------------------------------------------------------- /docs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "starlight-docs", 3 | "private": true, 4 | "type": "module", 5 | "version": "0.0.1", 6 | "scripts": { 7 | "test": "playwright install --with-deps chromium && playwright test", 8 | "dev": "astro dev", 9 | "start": "astro dev", 10 | "build": "astro build", 11 | "preview": "astro preview", 12 | "typecheck": "tsc --noEmit", 13 | "linkcheck": "CHECK_LINKS=true pnpm build", 14 | "astro": "astro", 15 | "lunaria:build": "lunaria build", 16 | "grammars": "node grammars/generate.mjs" 17 | }, 18 | "dependencies": { 19 | "@astro-community/astro-embed-youtube": "^0.5.6", 20 | "@astrojs/starlight": "workspace:*", 21 | "@lunariajs/core": "^0.1.1", 22 | "@types/culori": "^2.1.1", 23 | "astro": "^5.6.1", 24 | "culori": "^4.0.1", 25 | "sharp": "^0.32.5" 26 | }, 27 | "devDependencies": { 28 | "@playwright/test": "^1.45.0", 29 | "axe-playwright": "^2.0.3", 30 | "sitemapper": "^3.2.12", 31 | "starlight-links-validator": "^0.14.0" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /docs/playwright.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig, devices } from '@playwright/test'; 2 | 3 | export default defineConfig({ 4 | forbidOnly: !!process.env['CI'], 5 | projects: [ 6 | { 7 | name: 'Chrome Stable', 8 | use: { 9 | ...devices['Desktop Chrome'], 10 | headless: true, 11 | }, 12 | }, 13 | ], 14 | testMatch: '__a11y__/*.test.ts', 15 | // The timeout for the accessibility tests only. 16 | timeout: 180 * 1_000, 17 | webServer: [ 18 | { 19 | command: 'pnpm run build && pnpm run preview', 20 | reuseExistingServer: !process.env['CI'], 21 | stdout: 'pipe', 22 | // The timeout of the single build step ran before the accessibility tests. 23 | timeout: 120 * 1_000, 24 | url: 'http://localhost:4321', 25 | }, 26 | ], 27 | workers: 1, 28 | }); 29 | -------------------------------------------------------------------------------- /docs/public/_headers: -------------------------------------------------------------------------------- 1 | /_astro/* 2 | Cache-Control: public 3 | Cache-Control: max-age=31536000 4 | Cache-Control: immutable 5 | -------------------------------------------------------------------------------- /docs/public/_redirects: -------------------------------------------------------------------------------- 1 | # Proxy to Phat Houston from our Product Hunt launch — site operated by Otterlord 2 | /ph/* https://astro-houston-ph.pages.dev/ph/:splat 200 3 | 4 | # Moved content 5 | /zh/* /zh-cn/:splat 6 | /showcase/ /resources/showcase/ 7 | /:lang/showcase/ /:lang/resources/showcase/ 8 | 9 | # Component docs 10 | /guides/components/ /components/using-components/ 11 | /:lang/guides/components/ /:lang/components/using-components/ 12 | 13 | # Translated 404s 14 | /:lang/* /:lang/404/ 404 15 | /* /404/ 404 16 | -------------------------------------------------------------------------------- /docs/public/og.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/public/og.jpg -------------------------------------------------------------------------------- /docs/src/assets/hero-star.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/hero-star.webp -------------------------------------------------------------------------------- /docs/src/assets/landing.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --purple-hsl: 255, 60%, 60%; 3 | --overlay-blurple: hsla(var(--purple-hsl), 0.2); 4 | } 5 | 6 | :root[data-theme='light'] { 7 | --purple-hsl: 255, 85%, 65%; 8 | } 9 | 10 | [data-has-hero] .page { 11 | background: 12 | linear-gradient(215deg, var(--overlay-blurple), transparent 40%), 13 | radial-gradient(var(--overlay-blurple), transparent 40%) no-repeat -60vw -40vh / 105vw 200vh, 14 | radial-gradient(var(--overlay-blurple), transparent 65%) no-repeat 50% calc(100% + 20rem) / 15 | 60rem 30rem; 16 | } 17 | 18 | [data-has-hero] header { 19 | border-bottom: 1px solid transparent; 20 | background-color: transparent; 21 | -webkit-backdrop-filter: blur(16px); 22 | backdrop-filter: blur(16px); 23 | } 24 | 25 | [data-has-hero] .hero > img { 26 | filter: drop-shadow(0 0 3rem var(--overlay-blurple)); 27 | } 28 | -------------------------------------------------------------------------------- /docs/src/assets/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Allow: / 3 | 4 | Sitemap: https://starlight.astro.build/sitemap-index.xml 5 | -------------------------------------------------------------------------------- /docs/src/assets/showcase/accessible-astro.incluud.dev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/accessible-astro.incluud.dev.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/ai-prompt-snippets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/ai-prompt-snippets.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/api.dipsway.com.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/api.dipsway.com.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/astro-ghostcms.xyz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/astro-ghostcms.xyz.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/astro-snipcart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/astro-snipcart.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/brycerussell.github.io-qbcore-docs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/brycerussell.github.io-qbcore-docs.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/capgo.app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/capgo.app.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/capo.js.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/capo.js.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/codesweetly.com.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/codesweetly.com.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/contribute.freecodecamp.org.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/contribute.freecodecamp.org.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/crawler.siteone.io.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/crawler.siteone.io.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/create.bingo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/create.bingo.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/csmos.space.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/csmos.space.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/dev.vrchatfrance.fr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/dev.vrchatfrance.fr.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/developers.cloudflare.com.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/developers.cloudflare.com.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/dmno.dev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/dmno.dev.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/docs.astronvim.com.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/docs.astronvim.com.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/docs.cookie-api.com.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/docs.cookie-api.com.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/docs.emojiblast.dev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/docs.emojiblast.dev.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/docs.ethfollow.xyz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/docs.ethfollow.xyz.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/docs.flojoy.ai.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/docs.flojoy.ai.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/docs.fontawesome.com.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/docs.fontawesome.com.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/docs.ghostfam.com.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/docs.ghostfam.com.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/docs.mrrobot.app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/docs.mrrobot.app.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/docs.orama.com.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/docs.orama.com.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/docs.papermc.io.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/docs.papermc.io.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/docs.reactbricks.com.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/docs.reactbricks.com.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/docs.ryzekit.com.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/docs.ryzekit.com.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/document.saasfly.io.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/document.saasfly.io.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/drops-of-php.hi-folks.dev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/drops-of-php.hi-folks.dev.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/ee.qqv.com.au.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/ee.qqv.com.au.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/feedbackspark.com.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/feedbackspark.com.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/felicity.pages.dev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/felicity.pages.dev.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/fluid-dnd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/fluid-dnd.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/folksrouter.io.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/folksrouter.io.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/grpc.md.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/grpc.md.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/har.fyi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/har.fyi.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/how2neovim.io.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/how2neovim.io.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/ion.sst.dev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/ion.sst.dev.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/itihon.github.io-isomorphic-validation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/itihon.github.io-isomorphic-validation.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/kanriapp.com.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/kanriapp.com.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/kinde.com.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/kinde.com.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/knip.dev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/knip.dev.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/launchfa.st.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/launchfa.st.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/learnaiso.com.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/learnaiso.com.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/nostalgist.js.org.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/nostalgist.js.org.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/octo.guide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/octo.guide.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/onerepo.tools.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/onerepo.tools.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/openresource.dev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/openresource.dev.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/opensaas.sh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/opensaas.sh.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/pls.cli.rs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/pls.cli.rs.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/pokemon-siace.netlify.app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/pokemon-siace.netlify.app.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/quotesdomain.com.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/quotesdomain.com.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/react-awesome-reveal.morello.dev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/react-awesome-reveal.morello.dev.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/refact.ai.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/refact.ai.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/runs-on.com.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/runs-on.com.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/screenshotone.com.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/screenshotone.com.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/secco.lekoarts.de.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/secco.lekoarts.de.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/sibiraj-s.github.io-ngx-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/sibiraj-s.github.io-ngx-editor.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/sonar-team.github.io.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/sonar-team.github.io.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/starter.obytes.com.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/starter.obytes.com.jpg -------------------------------------------------------------------------------- /docs/src/assets/showcase/styledictionary.com.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/styledictionary.com.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/terrateam.io-docs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/terrateam.io-docs.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/texttotableconverter.com.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/texttotableconverter.com.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/truecharts.org.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/truecharts.org.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/tutorialkit.dev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/tutorialkit.dev.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/ucexlly.com.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/ucexlly.com.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/ui.full.dev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/ui.full.dev.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/webmonetization.org.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/webmonetization.org.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/www.athenaos.org.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/www.athenaos.org.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/www.devhealthos.com.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/www.devhealthos.com.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/www.pydocs.site.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/www.pydocs.site.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/xs-dev.js.org.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/xs-dev.js.org.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/yummacss.com.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/yummacss.com.png -------------------------------------------------------------------------------- /docs/src/assets/showcase/zumerlab.github.io.orbit-docs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/showcase/zumerlab.github.io.orbit-docs.png -------------------------------------------------------------------------------- /docs/src/assets/testimonials/BowTiedWebReapr.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/testimonials/BowTiedWebReapr.jpg -------------------------------------------------------------------------------- /docs/src/assets/testimonials/J_Everhart383.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/testimonials/J_Everhart383.jpg -------------------------------------------------------------------------------- /docs/src/assets/testimonials/RmeetsH.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/testimonials/RmeetsH.jpg -------------------------------------------------------------------------------- /docs/src/assets/testimonials/SylwiaVargas.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/testimonials/SylwiaVargas.jpg -------------------------------------------------------------------------------- /docs/src/assets/testimonials/beaussan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/testimonials/beaussan.jpg -------------------------------------------------------------------------------- /docs/src/assets/testimonials/flaviocopes.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/testimonials/flaviocopes.jpg -------------------------------------------------------------------------------- /docs/src/assets/testimonials/jhooks.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/testimonials/jhooks.jpg -------------------------------------------------------------------------------- /docs/src/assets/testimonials/loucyx.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/testimonials/loucyx.jpg -------------------------------------------------------------------------------- /docs/src/assets/testimonials/rachelnabors.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/testimonials/rachelnabors.jpg -------------------------------------------------------------------------------- /docs/src/assets/testimonials/rick_viscomi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/testimonials/rick_viscomi.jpg -------------------------------------------------------------------------------- /docs/src/assets/testimonials/solelychloe.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/testimonials/solelychloe.jpg -------------------------------------------------------------------------------- /docs/src/assets/testimonials/sulco.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/testimonials/sulco.jpg -------------------------------------------------------------------------------- /docs/src/assets/themes/black-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/themes/black-dark.png -------------------------------------------------------------------------------- /docs/src/assets/themes/black-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/themes/black-light.png -------------------------------------------------------------------------------- /docs/src/assets/themes/catppuccin-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/themes/catppuccin-dark.png -------------------------------------------------------------------------------- /docs/src/assets/themes/catppuccin-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/themes/catppuccin-light.png -------------------------------------------------------------------------------- /docs/src/assets/themes/flexoki-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/themes/flexoki-dark.png -------------------------------------------------------------------------------- /docs/src/assets/themes/flexoki-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/themes/flexoki-light.png -------------------------------------------------------------------------------- /docs/src/assets/themes/ion-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/themes/ion-dark.png -------------------------------------------------------------------------------- /docs/src/assets/themes/ion-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/themes/ion-light.png -------------------------------------------------------------------------------- /docs/src/assets/themes/nextjs-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/themes/nextjs-dark.png -------------------------------------------------------------------------------- /docs/src/assets/themes/nextjs-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/themes/nextjs-light.png -------------------------------------------------------------------------------- /docs/src/assets/themes/nova-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/themes/nova-dark.png -------------------------------------------------------------------------------- /docs/src/assets/themes/nova-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/themes/nova-light.png -------------------------------------------------------------------------------- /docs/src/assets/themes/obsidian-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/themes/obsidian-dark.png -------------------------------------------------------------------------------- /docs/src/assets/themes/obsidian-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/themes/obsidian-light.png -------------------------------------------------------------------------------- /docs/src/assets/themes/rapide-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/themes/rapide-dark.png -------------------------------------------------------------------------------- /docs/src/assets/themes/rapide-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/docs/src/assets/themes/rapide-light.png -------------------------------------------------------------------------------- /docs/src/components/component-preview.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { Tabs, TabItem } from '@astrojs/starlight/components'; 3 | 4 | const showContentTypeTabs = Astro.slots.has('markdoc'); 5 | --- 6 | 7 |
8 | { 9 | showContentTypeTabs ? ( 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | ) : ( 19 | 20 | ) 21 | } 22 |
23 |
{Astro.locals.t('component.preview')}
24 |
25 |
26 |
27 | 28 | 50 | -------------------------------------------------------------------------------- /docs/src/components/fluid-grid.astro: -------------------------------------------------------------------------------- 1 | --- 2 | interface Props { 3 | minColumnWidth?: string; 4 | gap?: string; 5 | } 6 | const { minColumnWidth, gap } = Astro.props; 7 | --- 8 | 9 |
10 | 11 | 23 | -------------------------------------------------------------------------------- /docs/src/components/media-card.astro: -------------------------------------------------------------------------------- 1 | --- 2 | interface Props { 3 | href?: string | undefined; 4 | } 5 | const { href } = Astro.props; 6 | const El = href ? 'a' : 'span'; 7 | --- 8 | 9 |
  • 10 | 11 |
    12 | 13 |
    14 |
  • 15 | 16 | 49 | -------------------------------------------------------------------------------- /docs/src/components/social-links-type.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { getRelativeLocaleUrl } from 'astro:i18n'; 3 | const href = getRelativeLocaleUrl(Astro.currentLocale ?? 'en', '/reference/icons/'); 4 | --- 5 | 6 | 7 | 8 | label: string; icon: StarlightIcon; href: string 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/src/components/testimonial-grid.astro: -------------------------------------------------------------------------------- 1 | --- 2 | interface Props { 3 | title: string; 4 | } 5 | 6 | const { title } = Astro.props; 7 | --- 8 | 9 |
    10 |

    {title}

    11 |
      12 | 13 |
    14 |
    15 | 16 | 40 | -------------------------------------------------------------------------------- /docs/src/components/theme-designer/atom.ts: -------------------------------------------------------------------------------- 1 | class Atom { 2 | #v: T; 3 | #subscribers = new Map<(v: T) => void, (v: T) => void>(); 4 | #notify = () => this.#subscribers.forEach((cb) => cb(this.#v)); 5 | constructor(init: T) { 6 | this.#v = init; 7 | } 8 | get(): T { 9 | return this.#v; 10 | } 11 | set(v: T): void { 12 | this.#v = v; 13 | this.#notify(); 14 | } 15 | subscribe(cb: (v: T) => void): () => boolean { 16 | cb(this.#v); 17 | this.#subscribers.set(cb, cb); 18 | return () => this.#subscribers.delete(cb); 19 | } 20 | } 21 | 22 | type MapStore = Atom & { setKey: (key: keyof T, value: T[typeof key]) => void }; 23 | 24 | export function map>(value: T): MapStore { 25 | const atom = new Atom(value) as MapStore; 26 | atom.setKey = (key: keyof T, value: T[typeof key]) => { 27 | const curr = atom.get(); 28 | if (curr[key] !== value) atom.set({ ...curr, [key]: value }); 29 | }; 30 | return atom; 31 | } 32 | 33 | export function atom(value: T): Atom { 34 | return new Atom(value); 35 | } 36 | -------------------------------------------------------------------------------- /docs/src/components/theme-designer/palette.astro: -------------------------------------------------------------------------------- 1 | --- 2 | interface Props { 3 | light?: boolean; 4 | } 5 | --- 6 | 7 |
    8 |
    9 | { 10 | Astro.props.light ? ( 11 |
    12 | ) : ( 13 |
    14 | ) 15 | } 16 |
    17 |
    18 |
    19 |
    20 |
    21 |
    22 |
    23 |
    24 | {Astro.props.light &&
    } 25 |
    26 |
    27 | 28 | 42 | -------------------------------------------------------------------------------- /docs/src/components/ui-strings-list.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { Code } from '@astrojs/starlight/components'; 3 | import uiStrings from '../../../packages/starlight/translations/en.json?raw'; 4 | --- 5 | 6 | 7 | -------------------------------------------------------------------------------- /docs/src/components/youtube-card.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { YouTube } from '@astro-community/astro-embed-youtube'; 3 | import MediaCard from './media-card.astro'; 4 | 5 | export interface Props { 6 | href: string; 7 | title: string; 8 | description?: string; 9 | } 10 | const { href, title, description } = Astro.props; 11 | --- 12 | 13 | 14 | 15 |
    16 |

    {title}

    17 | {description &&

    } 18 |

    19 |
    20 | 21 | 35 | -------------------------------------------------------------------------------- /docs/src/components/youtube-grid.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import FluidGrid from './fluid-grid.astro'; 3 | import YoutubeCard, { type Props as CardProps } from './youtube-card.astro'; 4 | 5 | interface Props { 6 | videos: CardProps[]; 7 | } 8 | --- 9 | 10 | 11 | {Astro.props.videos.map((video) => )} 12 | 13 | -------------------------------------------------------------------------------- /docs/src/content.config.ts: -------------------------------------------------------------------------------- 1 | import { defineCollection, z } from 'astro:content'; 2 | import { docsLoader, i18nLoader } from '@astrojs/starlight/loaders'; 3 | import { docsSchema, i18nSchema } from '@astrojs/starlight/schema'; 4 | 5 | export const collections = { 6 | docs: defineCollection({ 7 | loader: docsLoader(), 8 | schema: docsSchema(), 9 | }), 10 | i18n: defineCollection({ 11 | loader: i18nLoader(), 12 | schema: i18nSchema({ 13 | extend: z.object({ 14 | 'component.preview': z.string().optional(), 15 | }), 16 | }), 17 | }), 18 | }; 19 | -------------------------------------------------------------------------------- /docs/src/content/docs/404.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Not found 3 | template: splash 4 | editUrl: false 5 | lastUpdated: false 6 | hero: 7 | title: '404' 8 | tagline: Houston, we have a problem. We couldn’t find that page.
    Check the URL or try using the search bar. 9 | actions: 10 | - text: Go home 11 | icon: right-arrow 12 | link: / 13 | variant: primary 14 | --- 15 | -------------------------------------------------------------------------------- /docs/src/content/docs/da/404.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Ikke Fundet 3 | template: splash 4 | editUrl: false 5 | lastUpdated: false 6 | hero: 7 | title: '404' 8 | tagline: Houston, vi har et problem. Vi kunne ikke finde den side.
    Check URL'en eller prøv at bruge søgefeltet. 9 | actions: 10 | - text: Gå til hjem 11 | icon: right-arrow 12 | link: /da/ 13 | variant: primary 14 | --- 15 | -------------------------------------------------------------------------------- /docs/src/content/docs/de/404.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Nicht gefunden 3 | template: splash 4 | editUrl: false 5 | lastUpdated: false 6 | hero: 7 | title: '404' 8 | tagline: Houston, wir haben ein Problem. Wir konnten diese Seite nicht finden.
    Prüfe die URL oder verwende die Suchleiste. 9 | actions: 10 | - text: Zur Startseite 11 | icon: right-arrow 12 | link: /de/ 13 | variant: primary 14 | --- 15 | -------------------------------------------------------------------------------- /docs/src/content/docs/de/resources/showcase.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Starlight Schaufenster 3 | description: Entdecke Websites, die mit Starlight erstellt wurden! 4 | sidebar: 5 | label: Website-Schaufenster 6 | --- 7 | 8 | :::tip[Füge deine eigene hinzu!] 9 | Hast du eine Starlight-Website gebaut? 10 | [Eröffne einen PR](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md#showcase) und füge einen Link zu dieser Seite hinzu! 11 | ::: 12 | 13 | ## Websites 14 | 15 | import ShowcaseSites from '~/components/showcase-sites.astro'; 16 | 17 | Starlight wird bereits in der Produktion eingesetzt. Dies sind einige der Websites im Internet: 18 | 19 | 20 | 21 | Siehe alle [öffentlichen Projekt-Repos mit Starlight auf GitHub](https://github.com/withastro/starlight/network/dependents). 22 | -------------------------------------------------------------------------------- /docs/src/content/docs/es/404.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: No encontrada 3 | template: splash 4 | editUrl: false 5 | lastUpdated: false 6 | hero: 7 | title: '404' 8 | tagline: Houston, tenemos un problema. No pudimos encontrar esa página.
    Verifica la URL o intenta usar la barra de búsqueda. 9 | actions: 10 | - text: Ir a la Home 11 | icon: right-arrow 12 | link: /es/ 13 | variant: primary 14 | --- 15 | -------------------------------------------------------------------------------- /docs/src/content/docs/es/reference/icons.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Referencia de iconos 3 | description: Una descripción general de todos los iconos disponibles en Starlight. 4 | --- 5 | 6 | Starlight proporciona un conjunto de iconos integrados que puedes mostrar en tu contenido usando el componente ``. 7 | 8 | ## Usar iconos 9 | 10 | Los iconos se pueden mostrar usando el componente [``](/es/components/icons/). 11 | Estos también se utilizan a menudo en otros componentes, como [tarjetas](/es/components/cards/) o configuraciones como [acciones de hero](/es/reference/frontmatter/#hero). 12 | 13 | ## Todos los iconos 14 | 15 | Una lista de todos los iconos disponibles se muestra a continuación con sus nombres asociados. Haz clic en un icono para copiar su nombre al portapapeles. 16 | 17 | import IconsList from '~/components/icons-list.astro'; 18 | 19 | 20 | -------------------------------------------------------------------------------- /docs/src/content/docs/es/resources/showcase.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Exhibición de Starlight 3 | description: ¡Descubre sitios construidos con Starlight! 4 | sidebar: 5 | label: Galería de sitios 6 | --- 7 | 8 | :::tip[¡Agrega el tuyo!] 9 | ¿Has construido un sitio de Starlight o una herramienta para Starlight? 10 | ¡[Abre una PR](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md#showcase) agregando un enlace a esta página! 11 | ::: 12 | 13 | ## Sitios 14 | 15 | import ShowcaseSites from '~/components/showcase-sites.astro'; 16 | 17 | Starlight ya está siendo usado en producción. Estos son algunos de los sitios en la web: 18 | 19 | 20 | 21 | Mira todos los [repositorios públicos de proyectos usando Starlight en GitHub](https://github.com/withastro/starlight/network/dependents). 22 | -------------------------------------------------------------------------------- /docs/src/content/docs/fr/404.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Page Introuvable 3 | template: splash 4 | editUrl: false 5 | lastUpdated: false 6 | hero: 7 | title: '404' 8 | tagline: Houston, nous avons un problème. Nous n’avons pas pu trouver cette page.
    Vérifiez l’URL ou essayez la barre de recherche. 9 | actions: 10 | - text: Retourner à l’accueil 11 | icon: right-arrow 12 | link: /fr/ 13 | variant: primary 14 | --- 15 | -------------------------------------------------------------------------------- /docs/src/content/docs/fr/resources/showcase.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Vitrine Starlight 3 | description: Découvrez les sites construits avec Starlight ! 4 | sidebar: 5 | label: Vitrine des sites 6 | --- 7 | 8 | :::tip[Ajoutez le vôtre !] 9 | Avez-vous construit un site Starlight ? 10 | [Ouvrez une PR](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md#showcase) ajoutant un lien à cette page ! 11 | ::: 12 | 13 | ## Sites 14 | 15 | import ShowcaseSites from '~/components/showcase-sites.astro'; 16 | 17 | Starlight est déjà utilisé en production. Voici quelques sites sur le web : 18 | 19 | 20 | 21 | Voir tous les [dépôts publics de projets utilisant Starlight sur GitHub](https://github.com/withastro/starlight/network/dependents). 22 | -------------------------------------------------------------------------------- /docs/src/content/docs/hi/404.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: पेज नहीं मिला 3 | template: splash 4 | editUrl: false 5 | lastUpdated: false 6 | hero: 7 | title: '404' 8 | tagline: Houston, हमें एक समस्या है। हमें वह पेज नहीं मिला.
    URL जांचें या खोज बार का उपयोग करने का प्रयास करें। 9 | actions: 10 | - text: अवतरण पेज पर वापस आये 11 | icon: right-arrow 12 | link: /hi/ 13 | variant: primary 14 | --- 15 | -------------------------------------------------------------------------------- /docs/src/content/docs/id/404.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Halaman tidak ditemukan 3 | template: splash 4 | editUrl: false 5 | lastUpdated: false 6 | hero: 7 | title: '404' 8 | tagline: Houston, kita ada masalah. Halaman yang kita cari tidak ada.
    Tolong cek kolom URL atau gunakan fitur pencarian. 9 | actions: 10 | - text: Beranda 11 | icon: right-arrow 12 | link: /id/ 13 | variant: primary 14 | --- 15 | -------------------------------------------------------------------------------- /docs/src/content/docs/it/404.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Non trovato 3 | template: splash 4 | editUrl: false 5 | lastUpdated: false 6 | hero: 7 | title: '404' 8 | tagline: Houston, abbiamo un problema. Non siamo riusciti a trovare quella pagina.
    Controlla l'URL o prova a utilizzare la barra di ricerca. 9 | actions: 10 | - text: Torna alla home 11 | icon: right-arrow 12 | link: /it/ 13 | variant: primary 14 | --- 15 | -------------------------------------------------------------------------------- /docs/src/content/docs/it/resources/showcase.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Vetrina Starlight 3 | description: Scopri i siti creati con Starlight! 4 | sidebar: 5 | label: Vetrina siti 6 | --- 7 | 8 | :::tip[Aggiungi il tuo!] 9 | Hai creato un sito con Starlight? 10 | [Apri una PR](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md#showcase) così da aggiungere un link a questa pagina! 11 | ::: 12 | 13 | ## Siti 14 | 15 | import ShowcaseSites from '~/components/showcase-sites.astro'; 16 | 17 | Starlight è già utilizzato in produzione. Questi sono alcuni dei siti che lo usano: 18 | 19 | 20 | 21 | Vedi tutte le [repository di progetti pubblici che usano Starlight su GitHub](https://github.com/withastro/starlight/network/dependents). 22 | -------------------------------------------------------------------------------- /docs/src/content/docs/ja/404.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 見つかりませんでした 3 | template: splash 4 | editUrl: false 5 | lastUpdated: false 6 | hero: 7 | title: '404' 8 | tagline: Houston、問題が生じました。ページが見つかりませんでした。
    URLを確認するか、検索バーを使用してみてください。 9 | actions: 10 | - text: ホームに戻る 11 | icon: right-arrow 12 | link: /ja/ 13 | variant: primary 14 | --- 15 | -------------------------------------------------------------------------------- /docs/src/content/docs/ja/reference/icons.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: アイコン 3 | description: Starlightで利用可能なすべてのアイコンの概要。 4 | --- 5 | 6 | Starlightには、``コンポーネントを使用してコンテンツに表示できる、組み込みのアイコンセットが用意されています。 7 | 8 | ## アイコンの使用 9 | 10 | アイコンは[``](/ja/components/icons/)コンポーネントを使用して表示できます。また、[カード](/ja/components/cards/)や[ヒーローアクション](/ja/reference/frontmatter/#hero)の設定など、他のコンポーネントでもよく使用されます。 11 | 12 | ## すべてのアイコン 13 | 14 | 利用可能なすべてのアイコンとその関連名が以下にリストされています。アイコンをクリックすると、その名前がクリップボードにコピーされます。 15 | 16 | import IconsList from '~/components/icons-list.astro'; 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/src/content/docs/ja/resources/showcase.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Starlightショーケース 3 | description: Starlightで作成されたサイトをチェックしましょう! 4 | sidebar: 5 | label: サイト紹介 6 | --- 7 | 8 | :::tip[自分のものを追加しよう!] 9 | Starlightでサイトを作成しましたか?このページにリンクを追加する[PRを作成](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md#showcase)しましょう! 10 | ::: 11 | 12 | ## サイト 13 | 14 | import ShowcaseSites from '~/components/showcase-sites.astro'; 15 | 16 | Starlightはすでに本番環境で使用されています。以下は、ウェブ上のいくつかのサイトです。 17 | 18 | 19 | 20 | [Starlightを使用しているパブリックなプロジェクトのGitHubリポジトリ](https://github.com/withastro/starlight/network/dependents)を確認してみてください。 21 | -------------------------------------------------------------------------------- /docs/src/content/docs/ko/404.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 페이지를 찾을 수 없습니다. 3 | template: splash 4 | editUrl: false 5 | lastUpdated: false 6 | hero: 7 | title: '404' 8 | tagline: Houston, 문제가 생겼어요. 페이지를 찾을 수 없습니다.
    URL을 다시 확인해보거나 검색을 사용해보세요. 9 | actions: 10 | - text: 홈으로 이동 11 | icon: right-arrow 12 | link: /ko/ 13 | variant: primary 14 | --- 15 | -------------------------------------------------------------------------------- /docs/src/content/docs/ko/reference/icons.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 아이콘 참조 3 | description: Starlight에서 사용할 수 있는 모든 아이콘에 대한 개요입니다. 4 | --- 5 | 6 | Starlight는 `` 컴포넌트를 사용하여 콘텐츠에 표시할 수 있는 내장 아이콘 세트를 제공합니다. 7 | 8 | ## 아이콘 사용 9 | 10 | 아이콘은 [``](/ko/components/icons/) 컴포넌트를 사용하여 표시할 수 있습니다. 11 | 또한 [카드](/ko/components/cards/)와 같은 다른 컴포넌트나 [히어로 액션](/ko/reference/frontmatter/#hero)과 같은 설정에서도 자주 사용됩니다. 12 | 13 | ## `StarlightIcon` 타입 14 | 15 | `StarlightIcon` TypeScript 타입을 사용하여 [Starlight의 기본 제공 아이콘](#모든-아이콘)의 이름을 참조할 수 있습니다. 16 | 17 | ```ts {2} /icon: (StarlightIcon)/ 18 | // src/icon.ts 19 | import type { StarlightIcon } from '@astrojs/starlight/types'; 20 | 21 | function getIconLabel(icon: StarlightIcon) { 22 | // … 23 | } 24 | ``` 25 | 26 | ## 모든 아이콘 27 | 28 | 사용 가능한 모든 아이콘의 목록과 관련 이름이 아래에 나와 있습니다. 아이콘을 클릭하면 해당 이름을 클립보드에 복사할 수 있습니다. 29 | 30 | import IconsList from '~/components/icons-list.astro'; 31 | 32 | 33 | -------------------------------------------------------------------------------- /docs/src/content/docs/ko/resources/showcase.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Starlight 쇼케이스 3 | description: Starlight로 구축된 사이트를 찾아보세요! 4 | sidebar: 5 | label: 사이트 쇼케이스 6 | --- 7 | 8 | :::tip[직접 추가하세요!] 9 | Starlight 사이트를 구축하셨나요? 10 | 이 페이지에 링크를 추가하는 [PR을 오픈하세요](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md#showcase)! 11 | ::: 12 | 13 | ## 사이트 14 | 15 | import ShowcaseSites from '~/components/showcase-sites.astro'; 16 | 17 | Starlight는 이미 프로덕션에 사용되고 있습니다. 다음은 웹사이트 중 일부입니다. 18 | 19 | 20 | 21 | [GitHub에서 Starlight를 사용하는 공개 프로젝트 저장소](https://github.com/withastro/starlight/network/dependents)를 모두 확인하세요. 22 | -------------------------------------------------------------------------------- /docs/src/content/docs/pt-br/404.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Não encontrado 3 | template: splash 4 | editUrl: false 5 | lastUpdated: false 6 | hero: 7 | title: '404' 8 | tagline: Houston, temos um problema. Não conseguimos encontrar essa página.
    Verifique a URL ou tente utilizar a barra de pesquisa. 9 | actions: 10 | - text: Ir para o início 11 | icon: right-arrow 12 | link: /pt-br/ 13 | variant: primary 14 | --- 15 | -------------------------------------------------------------------------------- /docs/src/content/docs/pt-br/resources/showcase.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Vitrine Starlight 3 | description: Descubra sites construídos com Starlight! 4 | sidebar: 5 | label: Vitrine de Sites 6 | --- 7 | 8 | :::tip[Adicione o seu!] 9 | Você construiu um site com Starlight? 10 | [Abra um PR](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md#showcase) adicionando um link para esta página! 11 | ::: 12 | 13 | ## Sites 14 | 15 | import ShowcaseSites from '~/components/showcase-sites.astro'; 16 | 17 | Starlight já está sendo usado em produção. Esses são alguns sites que estão pela web: 18 | 19 | 20 | 21 | Veja todos os [repositórios de projetos públicos usando Starlight no GitHub](https://github.com/withastro/starlight/network/dependents). 22 | -------------------------------------------------------------------------------- /docs/src/content/docs/pt-pt/404.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Não encontrado 3 | template: splash 4 | editUrl: false 5 | lastUpdated: false 6 | hero: 7 | title: '404' 8 | tagline: Houston, temos um problema. Não conseguimos encontrar esta página.
    Verifique se o URL está correto ou tente utilizar a barra de pesquisa. 9 | actions: 10 | - text: Ir para o início 11 | icon: right-arrow 12 | link: /pt-pt/ 13 | variant: primary 14 | --- 15 | -------------------------------------------------------------------------------- /docs/src/content/docs/pt-pt/resources/showcase.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Montra Starlight 3 | description: Descubra sites construídos com Starlight! 4 | sidebar: 5 | label: Montra de Sites 6 | --- 7 | 8 | :::tip[Inclua o seu!] 9 | Já construiu um site com o Starlight? 10 | Então abra um PR e adicione o seu link nesta página! 11 | ::: 12 | 13 | ## Sites 14 | 15 | import ShowcaseSites from '~/components/showcase-sites.astro'; 16 | 17 | O Starlight já está a ser usado em muitos sites em produção. Estes são alguns desses sites já espalhados pela web: 18 | 19 | 20 | 21 | Pesquise todos os [repositórios de projetos públicos que usam o Starlight no GitHub](https://github.com/withastro/starlight/network/dependents). 22 | -------------------------------------------------------------------------------- /docs/src/content/docs/reference/icons.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Icons Reference 3 | description: An overview of all the icons available in Starlight. 4 | --- 5 | 6 | Starlight provides a set of built-in icons that you can display in your content using the `` component. 7 | 8 | ## Use icons 9 | 10 | Icons can be displayed using the [``](/components/icons/) component. 11 | They are also often used in other components, such as [cards](/components/cards/) or settings like [hero actions](/reference/frontmatter/#hero). 12 | 13 | ## `StarlightIcon` type 14 | 15 | Use the `StarlightIcon` TypeScript type to reference the names of [Starlight’s built-in icons](#all-icons). 16 | 17 | ```ts {2} /icon: (StarlightIcon)/ 18 | // src/icon.ts 19 | import type { StarlightIcon } from '@astrojs/starlight/types'; 20 | 21 | function getIconLabel(icon: StarlightIcon) { 22 | // … 23 | } 24 | ``` 25 | 26 | ## All icons 27 | 28 | A list of all available icons is shown below with their associated names. Click an icon to copy its name to your clipboard. 29 | 30 | import IconsList from '~/components/icons-list.astro'; 31 | 32 | 33 | -------------------------------------------------------------------------------- /docs/src/content/docs/resources/showcase.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Starlight Showcase 3 | description: Discover sites built with Starlight! 4 | sidebar: 5 | label: Site Showcase 6 | --- 7 | 8 | :::tip[Add your own!] 9 | Have you built a Starlight site? 10 | [Open a PR](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md#showcase) adding a link to this page! 11 | ::: 12 | 13 | ## Sites 14 | 15 | import ShowcaseSites from '~/components/showcase-sites.astro'; 16 | 17 | Starlight is already being used in production. These are some of the sites around the web: 18 | 19 | 20 | 21 | See all the [public project repos using Starlight on GitHub](https://github.com/withastro/starlight/network/dependents). 22 | -------------------------------------------------------------------------------- /docs/src/content/docs/ru/404.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Не найдено 3 | template: splash 4 | editUrl: false 5 | lastUpdated: false 6 | hero: 7 | title: '404' 8 | tagline: Хьюстон, у нас проблемы. Мы не смогли найти эту страницу.
    Проверьте URL или попробуйте использовать поиск. 9 | actions: 10 | - text: На главную 11 | icon: right-arrow 12 | link: /ru/ 13 | variant: primary 14 | --- 15 | -------------------------------------------------------------------------------- /docs/src/content/docs/ru/reference/icons.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Иконки 3 | description: Обзор всех иконок, доступных в Starlight. 4 | --- 5 | 6 | Starlight предоставляет набор общих иконок, которые вы можете отображать в своем контенте, используя компонент ``. 7 | 8 | ## Использование иконок 9 | 10 | Иконки можно отображать с помощью компонента [``](/ru/components/icons/). 11 | Они также часто используются в других компонентах, таких как [карточки](/ru/components/cards/) или в настройках, таких как [hero](/ru/reference/frontmatter/#hero). 12 | 13 | ## Тип `StarlightIcon` 14 | 15 | Используйте тип TypeScript `StarlightIcon`, чтобы ссылаться на названия [встроенных иконок Starlight](#все-иконки). 16 | 17 | ```ts {2} /icon: (StarlightIcon)/ 18 | // src/icon.ts 19 | import type { StarlightIcon } from '@astrojs/starlight/types'; 20 | 21 | function getIconLabel(icon: StarlightIcon) { 22 | // … 23 | } 24 | ``` 25 | 26 | ## Все иконки 27 | 28 | Список всех доступных иконок показан ниже с их соответствующими именами. Кликните по значку, чтобы скопировать код компонента для него. 29 | 30 | import IconsList from '~/components/icons-list.astro'; 31 | 32 | 33 | -------------------------------------------------------------------------------- /docs/src/content/docs/ru/resources/showcase.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Витрина Starlight 3 | description: Откройте для себя сайты, созданные с помощью Starlight! 4 | sidebar: 5 | label: Витрина сайтов 6 | --- 7 | 8 | :::tip[Добавьте свой собственный сайт!] 9 | Вы создали сайт с помощью Starlight? 10 | [Откройте PR](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md#showcase), добавив ссылку на эту страницу! 11 | ::: 12 | 13 | ## Сайты 14 | 15 | import ShowcaseSites from '~/components/showcase-sites.astro'; 16 | 17 | Starlight уже используется в производстве. Вот некоторые из сайтов в Интернете: 18 | 19 | 20 | 21 | Посмотреть все [публичные репозитории проектов, использующих Starlight, на GitHub](https://github.com/withastro/starlight/network/dependents). 22 | -------------------------------------------------------------------------------- /docs/src/content/docs/tr/404.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Sayfa Bulunamadı 3 | template: splash 4 | editUrl: false 5 | lastUpdated: false 6 | hero: 7 | title: '404' 8 | tagline: Houston, bi' problem var. Bu sayfayı bulamadık.
    URL'i kontrol et ya da arama çubuğunu kullanmayı dene. 9 | actions: 10 | - text: Ana Sayfaya Git 11 | icon: right-arrow 12 | link: /tr/ 13 | variant: primary 14 | --- 15 | -------------------------------------------------------------------------------- /docs/src/content/docs/tr/resources/showcase.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Starlight Vitrini 3 | description: Starlight ile hazırlanmış siteleri keşfet! 4 | sidebar: 5 | label: Site Vitrini 6 | --- 7 | 8 | :::tip[Seninkini ekle!] 9 | Starlight ile site yaptın mı? 10 | Bu sayfaya bağlantı eklemek için [PR açın](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md#showcase)! 11 | ::: 12 | 13 | ## Siteler 14 | 15 | import ShowcaseSites from '~/components/showcase-sites.astro'; 16 | 17 | Starlight halihazırda canlıda kullanılıyor. Web'deki bazı siteler şunlar: 18 | 19 | 20 | 21 | [Github üzerinde Starlight kullanan herkese açık proje repolarının](https://github.com/withastro/starlight/network/dependents) tümüne bakın. 22 | -------------------------------------------------------------------------------- /docs/src/content/docs/uk/404.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Не знайдено 3 | template: splash 4 | editUrl: false 5 | lastUpdated: false 6 | hero: 7 | title: '404' 8 | tagline: Г'юстоне, у нас проблема. Ми не змогли знайти цю сторінку.
    Перевірте URL або спробуйте скористатися пошуком. 9 | actions: 10 | - text: Додому 11 | icon: right-arrow 12 | link: /uk/ 13 | variant: primary 14 | --- 15 | -------------------------------------------------------------------------------- /docs/src/content/docs/zh-cn/404.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 页面未找到 3 | template: splash 4 | editUrl: false 5 | lastUpdated: false 6 | hero: 7 | title: '404' 8 | tagline: 休斯顿,我们遇到了一个问题。我们找不到该页面。
    请检查 URL 或尝试使用搜索栏。 9 | actions: 10 | - text: 返回首页 11 | icon: right-arrow 12 | link: /zh-cn/ 13 | variant: primary 14 | --- 15 | -------------------------------------------------------------------------------- /docs/src/content/docs/zh-cn/reference/icons.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 图标参考 3 | description: Starlight 中所有可用图标的概述。 4 | --- 5 | 6 | Starlight 提供了一组内置图标,你可以使用 `` 组件在内容中显示这些图标。 7 | 8 | ## 使用图标 9 | 10 | 可以使用 [``](/zh-cn/components/icons/) 组件来显示图标。 11 | 图标也常用于其他组件,例如 [卡片](/zh-cn/components/cards/) 或 [hero actions](/zh-cn/reference/frontmatter/#hero) 等设置。 12 | 13 | ## `StarlightIcon` 类型 14 | 15 | 使用 `StarlightIcon` TypeScript 类型来引用 [Starlight 的内置图标的名称](#所有图标)。 16 | 17 | ```ts {2} /icon: (StarlightIcon)/ 18 | // src/icon.ts 19 | import type { StarlightIcon } from '@astrojs/starlight/types'; 20 | 21 | function getIconLabel(icon: StarlightIcon) { 22 | // … 23 | } 24 | ``` 25 | 26 | ## 所有图标 27 | 28 | 下面显示了所有可用图标,包括它们对应名称的列表。单击图标将其名称复制到剪贴板。 29 | 30 | import IconsList from '~/components/icons-list.astro'; 31 | 32 | 33 | -------------------------------------------------------------------------------- /docs/src/content/docs/zh-cn/resources/showcase.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Starlight 展示 3 | description: 发现用 Starlight 构建的网站! 4 | sidebar: 5 | label: 网站展示 6 | --- 7 | 8 | :::tip[添加你自己的!] 9 | 你是否构建过 Starlight 网站? 10 | [创建一个 PR](https://github.com/withastro/starlight/blob/main/CONTRIBUTING.md#showcase) 来添加链接到此页面! 11 | ::: 12 | 13 | ## 网站 14 | 15 | import ShowcaseSites from '~/components/showcase-sites.astro'; 16 | 17 | Starlight 已投入生产。 这些是网络上的一些网站: 18 | 19 | 20 | 21 | 查看所有[在 GitHub 上使用 Starlight 的公共项目仓库](https://github.com/withastro/starlight/network/dependents)。 22 | -------------------------------------------------------------------------------- /docs/src/content/i18n/de.json: -------------------------------------------------------------------------------- 1 | { 2 | "component.preview": "Vorschau" 3 | } 4 | -------------------------------------------------------------------------------- /docs/src/content/i18n/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "component.preview": "Preview" 3 | } 4 | -------------------------------------------------------------------------------- /docs/src/content/i18n/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "component.preview": "Aperçu" 3 | } 4 | -------------------------------------------------------------------------------- /docs/src/content/i18n/ja.json: -------------------------------------------------------------------------------- 1 | { 2 | "component.preview": "プレビュー" 3 | } 4 | -------------------------------------------------------------------------------- /docs/src/content/i18n/ko.json: -------------------------------------------------------------------------------- 1 | { 2 | "component.preview": "미리보기" 3 | } 4 | -------------------------------------------------------------------------------- /docs/src/content/i18n/ru.json: -------------------------------------------------------------------------------- 1 | { 2 | "component.preview": "Превью" 3 | } 4 | -------------------------------------------------------------------------------- /docs/src/content/i18n/zh-CN.json: -------------------------------------------------------------------------------- 1 | { 2 | "component.preview": "预览" 3 | } 4 | -------------------------------------------------------------------------------- /docs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "astro/tsconfigs/strictest", 3 | "compilerOptions": { 4 | "baseUrl": ".", 5 | "paths": { 6 | "~/*": ["src/*"] 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/basics/.gitignore: -------------------------------------------------------------------------------- 1 | # build output 2 | dist/ 3 | # generated types 4 | .astro/ 5 | 6 | # dependencies 7 | node_modules/ 8 | 9 | # logs 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | pnpm-debug.log* 14 | 15 | 16 | # environment variables 17 | .env 18 | .env.production 19 | 20 | # macOS-specific files 21 | .DS_Store 22 | -------------------------------------------------------------------------------- /examples/basics/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["astro-build.astro-vscode"], 3 | "unwantedRecommendations": [] 4 | } 5 | -------------------------------------------------------------------------------- /examples/basics/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "command": "./node_modules/.bin/astro dev", 6 | "name": "Development server", 7 | "request": "launch", 8 | "type": "node-terminal" 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /examples/basics/astro.config.mjs: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import { defineConfig } from 'astro/config'; 3 | import starlight from '@astrojs/starlight'; 4 | 5 | // https://astro.build/config 6 | export default defineConfig({ 7 | integrations: [ 8 | starlight({ 9 | title: 'My Docs', 10 | social: [{ icon: 'github', label: 'GitHub', href: 'https://github.com/withastro/starlight' }], 11 | sidebar: [ 12 | { 13 | label: 'Guides', 14 | items: [ 15 | // Each item here is one entry in the navigation menu. 16 | { label: 'Example Guide', slug: 'guides/example' }, 17 | ], 18 | }, 19 | { 20 | label: 'Reference', 21 | autogenerate: { directory: 'reference' }, 22 | }, 23 | ], 24 | }), 25 | ], 26 | }); 27 | -------------------------------------------------------------------------------- /examples/basics/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@example/starlight-basics", 3 | "type": "module", 4 | "version": "0.0.1", 5 | "private": true, 6 | "scripts": { 7 | "dev": "astro dev", 8 | "start": "astro dev", 9 | "build": "astro build", 10 | "preview": "astro preview", 11 | "astro": "astro" 12 | }, 13 | "dependencies": { 14 | "@astrojs/starlight": "^0.34.3", 15 | "astro": "^5.6.1", 16 | "sharp": "^0.32.5" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /examples/basics/public/favicon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/basics/src/assets/houston.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/examples/basics/src/assets/houston.webp -------------------------------------------------------------------------------- /examples/basics/src/content.config.ts: -------------------------------------------------------------------------------- 1 | import { defineCollection } from 'astro:content'; 2 | import { docsLoader } from '@astrojs/starlight/loaders'; 3 | import { docsSchema } from '@astrojs/starlight/schema'; 4 | 5 | export const collections = { 6 | docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }), 7 | }; 8 | -------------------------------------------------------------------------------- /examples/basics/src/content/docs/guides/example.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Example Guide 3 | description: A guide in my new Starlight docs site. 4 | --- 5 | 6 | Guides lead a user through a specific task they want to accomplish, often with a sequence of steps. 7 | Writing a good guide requires thinking about what your users are trying to do. 8 | 9 | ## Further reading 10 | 11 | - Read [about how-to guides](https://diataxis.fr/how-to-guides/) in the Diátaxis framework 12 | -------------------------------------------------------------------------------- /examples/basics/src/content/docs/reference/example.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Example Reference 3 | description: A reference page in my new Starlight docs site. 4 | --- 5 | 6 | Reference pages are ideal for outlining how things work in terse and clear terms. 7 | Less concerned with telling a story or addressing a specific use case, they should give a comprehensive outline of what you're documenting. 8 | 9 | ## Further reading 10 | 11 | - Read [about reference](https://diataxis.fr/reference/) in the Diátaxis framework 12 | -------------------------------------------------------------------------------- /examples/basics/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "astro/tsconfigs/strict", 3 | "include": [".astro/types.d.ts", "**/*"], 4 | "exclude": ["dist"] 5 | } 6 | -------------------------------------------------------------------------------- /examples/markdoc/.gitignore: -------------------------------------------------------------------------------- 1 | # build output 2 | dist/ 3 | # generated types 4 | .astro/ 5 | 6 | # dependencies 7 | node_modules/ 8 | 9 | # logs 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | pnpm-debug.log* 14 | 15 | 16 | # environment variables 17 | .env 18 | .env.production 19 | 20 | # macOS-specific files 21 | .DS_Store 22 | -------------------------------------------------------------------------------- /examples/markdoc/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["astro-build.astro-vscode", "stripe.markdoc-language-support"], 3 | "unwantedRecommendations": [] 4 | } 5 | -------------------------------------------------------------------------------- /examples/markdoc/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "command": "./node_modules/.bin/astro dev", 6 | "name": "Development server", 7 | "request": "launch", 8 | "type": "node-terminal" 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /examples/markdoc/astro.config.mjs: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import { defineConfig } from 'astro/config'; 3 | import starlight from '@astrojs/starlight'; 4 | import markdoc from '@astrojs/markdoc'; 5 | 6 | // https://astro.build/config 7 | export default defineConfig({ 8 | integrations: [ 9 | markdoc(), 10 | starlight({ 11 | title: 'My Docs', 12 | social: [{ icon: 'github', label: 'GitHub', href: 'https://github.com/withastro/starlight' }], 13 | sidebar: [ 14 | { 15 | label: 'Guides', 16 | items: [ 17 | // Each item here is one entry in the navigation menu. 18 | { label: 'Example Guide', slug: 'guides/example' }, 19 | ], 20 | }, 21 | { 22 | label: 'Reference', 23 | autogenerate: { directory: 'reference' }, 24 | }, 25 | ], 26 | }), 27 | ], 28 | }); 29 | -------------------------------------------------------------------------------- /examples/markdoc/markdoc.config.mjs: -------------------------------------------------------------------------------- 1 | import { defineMarkdocConfig } from '@astrojs/markdoc/config'; 2 | import starlightMarkdoc from '@astrojs/starlight-markdoc'; 3 | 4 | // https://docs.astro.build/en/guides/integrations-guide/markdoc/ 5 | export default defineMarkdocConfig({ 6 | extends: [starlightMarkdoc()], 7 | }); 8 | -------------------------------------------------------------------------------- /examples/markdoc/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@example/starlight-markdoc", 3 | "type": "module", 4 | "version": "0.0.1", 5 | "private": true, 6 | "scripts": { 7 | "dev": "astro dev", 8 | "start": "astro dev", 9 | "build": "astro build", 10 | "preview": "astro preview", 11 | "astro": "astro" 12 | }, 13 | "dependencies": { 14 | "@astrojs/markdoc": "^0.13.3", 15 | "@astrojs/starlight": "^0.34.3", 16 | "@astrojs/starlight-markdoc": "^0.4.0", 17 | "astro": "^5.6.1", 18 | "sharp": "^0.32.5" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /examples/markdoc/public/favicon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/markdoc/src/assets/houston.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/examples/markdoc/src/assets/houston.webp -------------------------------------------------------------------------------- /examples/markdoc/src/content.config.ts: -------------------------------------------------------------------------------- 1 | import { defineCollection } from 'astro:content'; 2 | import { docsLoader } from '@astrojs/starlight/loaders'; 3 | import { docsSchema } from '@astrojs/starlight/schema'; 4 | 5 | export const collections = { 6 | docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }), 7 | }; 8 | -------------------------------------------------------------------------------- /examples/markdoc/src/content/docs/guides/example.mdoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Example Guide 3 | description: A guide in my new Starlight docs site. 4 | --- 5 | 6 | Guides lead a user through a specific task they want to accomplish, often with a sequence of steps. 7 | Writing a good guide requires thinking about what your users are trying to do. 8 | 9 | ## Further reading 10 | 11 | - Read [about how-to guides](https://diataxis.fr/how-to-guides/) in the Diátaxis framework 12 | -------------------------------------------------------------------------------- /examples/markdoc/src/content/docs/index.mdoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Welcome to Starlight 3 | description: Get started building your docs site with Starlight. 4 | template: splash 5 | hero: 6 | title: Welcome to Starlight with Markdoc 7 | tagline: Congrats on setting up a new Starlight project! 8 | image: 9 | file: ../../assets/houston.webp 10 | actions: 11 | - text: Example Guide 12 | link: /guides/example/ 13 | icon: right-arrow 14 | - text: Read the Starlight docs 15 | link: https://starlight.astro.build 16 | icon: external 17 | variant: minimal 18 | --- 19 | 20 | ## Next steps 21 | 22 | {% cardgrid stagger=true %} 23 | {% card title="Update content" icon="pencil" %} 24 | Edit `src/content/docs/index.mdoc` to see this page change. 25 | {% /card %} 26 | {% card title="Add new content" icon="add-document" %} 27 | Add Markdoc files to `src/content/docs` to create new pages. 28 | {% /card %} 29 | {% card title="Configure your site" icon="setting" %} 30 | Edit your `sidebar` and other config in `astro.config.mjs`. 31 | {% /card %} 32 | {% card title="Read the docs" icon="open-book" %} 33 | Learn more in [the Starlight Docs](https://starlight.astro.build/). 34 | {% /card %} 35 | {% /cardgrid %} 36 | -------------------------------------------------------------------------------- /examples/markdoc/src/content/docs/reference/example.mdoc: -------------------------------------------------------------------------------- 1 | --- 2 | title: Example Reference 3 | description: A reference page in my new Starlight docs site. 4 | --- 5 | 6 | Reference pages are ideal for outlining how things work in terse and clear terms. 7 | Less concerned with telling a story or addressing a specific use case, they should give a comprehensive outline of what you're documenting. 8 | 9 | ## Further reading 10 | 11 | - Read [about reference](https://diataxis.fr/reference/) in the Diátaxis framework 12 | -------------------------------------------------------------------------------- /examples/markdoc/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "astro/tsconfigs/strict", 3 | "include": [".astro/types.d.ts", "**/*"], 4 | "exclude": ["dist"] 5 | } 6 | -------------------------------------------------------------------------------- /examples/tailwind/.gitignore: -------------------------------------------------------------------------------- 1 | # build output 2 | dist/ 3 | # generated types 4 | .astro/ 5 | 6 | # dependencies 7 | node_modules/ 8 | 9 | # logs 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | pnpm-debug.log* 14 | 15 | 16 | # environment variables 17 | .env 18 | .env.production 19 | 20 | # macOS-specific files 21 | .DS_Store 22 | -------------------------------------------------------------------------------- /examples/tailwind/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["astro-build.astro-vscode"], 3 | "unwantedRecommendations": [] 4 | } 5 | -------------------------------------------------------------------------------- /examples/tailwind/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "command": "./node_modules/.bin/astro dev", 6 | "name": "Development server", 7 | "request": "launch", 8 | "type": "node-terminal" 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /examples/tailwind/astro.config.mjs: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import { defineConfig } from 'astro/config'; 3 | import starlight from '@astrojs/starlight'; 4 | import tailwindcss from '@tailwindcss/vite'; 5 | 6 | // https://astro.build/config 7 | export default defineConfig({ 8 | integrations: [ 9 | starlight({ 10 | title: 'Docs with Tailwind', 11 | social: [{ icon: 'github', label: 'GitHub', href: 'https://github.com/withastro/starlight' }], 12 | sidebar: [ 13 | { 14 | label: 'Guides', 15 | items: [ 16 | // Each item here is one entry in the navigation menu. 17 | { label: 'Example Guide', slug: 'guides/example' }, 18 | ], 19 | }, 20 | { 21 | label: 'Reference', 22 | autogenerate: { directory: 'reference' }, 23 | }, 24 | ], 25 | customCss: ['./src/styles/global.css'], 26 | }), 27 | ], 28 | vite: { 29 | plugins: [tailwindcss()], 30 | }, 31 | }); 32 | -------------------------------------------------------------------------------- /examples/tailwind/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@example/starlight-tailwind", 3 | "type": "module", 4 | "version": "0.0.1", 5 | "private": true, 6 | "scripts": { 7 | "dev": "astro dev", 8 | "start": "astro dev", 9 | "build": "astro build", 10 | "preview": "astro preview", 11 | "astro": "astro" 12 | }, 13 | "dependencies": { 14 | "@astrojs/starlight": "^0.34.3", 15 | "@astrojs/starlight-tailwind": "^4.0.1", 16 | "@tailwindcss/vite": "^4.0.7", 17 | "astro": "^5.6.1", 18 | "sharp": "^0.32.5", 19 | "tailwindcss": "^4.0.7" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /examples/tailwind/public/favicon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/tailwind/src/assets/houston.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/examples/tailwind/src/assets/houston.webp -------------------------------------------------------------------------------- /examples/tailwind/src/content.config.ts: -------------------------------------------------------------------------------- 1 | import { defineCollection } from 'astro:content'; 2 | import { docsLoader } from '@astrojs/starlight/loaders'; 3 | import { docsSchema } from '@astrojs/starlight/schema'; 4 | 5 | export const collections = { 6 | docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }), 7 | }; 8 | -------------------------------------------------------------------------------- /examples/tailwind/src/content/docs/guides/example.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Example Guide 3 | description: A guide in my new Starlight docs site. 4 | --- 5 | 6 | Guides lead a user through a specific task they want to accomplish, often with a sequence of steps. 7 | Writing a good guide requires thinking about what your users are trying to do. 8 | 9 | ## Further reading 10 | 11 | - Read [about how-to guides](https://diataxis.fr/how-to-guides/) in the Diátaxis framework 12 | -------------------------------------------------------------------------------- /examples/tailwind/src/content/docs/reference/example.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Example Reference 3 | description: A reference page in my new Starlight docs site. 4 | --- 5 | 6 | Reference pages are ideal for outlining how things work in terse and clear terms. 7 | Less concerned with telling a story or addressing a specific use case, they should give a comprehensive outline of what your documenting. 8 | 9 | ## Further reading 10 | 11 | - Read [about reference](https://diataxis.fr/reference/) in the Diátaxis framework 12 | -------------------------------------------------------------------------------- /examples/tailwind/src/styles/global.css: -------------------------------------------------------------------------------- 1 | @layer base, starlight, theme, components, utilities; 2 | 3 | @import '@astrojs/starlight-tailwind'; 4 | @import 'tailwindcss/theme.css' layer(theme); 5 | @import 'tailwindcss/utilities.css' layer(utilities); 6 | 7 | @theme { 8 | /* 9 | Configure your Tailwind theme that will be used by Starlight. 10 | https://starlight.astro.build/guides/css-and-tailwind/#styling-starlight-with-tailwind 11 | */ 12 | } 13 | 14 | /* 15 | Add additional Tailwind styles to this file: 16 | https://tailwindcss.com/docs/adding-custom-styles#using-custom-css 17 | */ 18 | -------------------------------------------------------------------------------- /examples/tailwind/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "astro/tsconfigs/strict", 3 | "include": [".astro/types.d.ts", "**/*"], 4 | "exclude": ["dist"] 5 | } 6 | -------------------------------------------------------------------------------- /packages/docsearch/README.md: -------------------------------------------------------------------------------- 1 | # @astrojs/starlight-docsearch 2 | 3 | Algolia DocSearch plugin for the [Starlight][starlight] documentation theme for [Astro][astro]. 4 | 5 | ## Documentation 6 | 7 | See the [Starlight site search guide][docs] for how to use this plugin. 8 | 9 | ## License 10 | 11 | MIT 12 | 13 | Copyright (c) 2023–present [Starlight contributors][contributors] 14 | 15 | [starlight]: https://starlight.astro.build/ 16 | [astro]: https://astro.build/ 17 | [docs]: https://starlight.astro.build/guides/site-search/#algolia-docsearch 18 | [contributors]: https://github.com/withastro/starlight/graphs/contributors 19 | -------------------------------------------------------------------------------- /packages/docsearch/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@astrojs/starlight-docsearch", 3 | "version": "0.6.0", 4 | "description": "Algolia DocSearch plugin for the Starlight documentation theme for Astro", 5 | "author": "Chris Swithinbank ", 6 | "license": "MIT", 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/withastro/starlight", 10 | "directory": "packages/docsearch" 11 | }, 12 | "bugs": "https://github.com/withastro/starlight/issues", 13 | "homepage": "https://starlight.astro.build", 14 | "type": "module", 15 | "files": [ 16 | "index.ts", 17 | "DocSearch.astro", 18 | "schema.ts", 19 | "variables.css", 20 | "virtual.d.ts" 21 | ], 22 | "exports": { 23 | ".": "./index.ts", 24 | "./DocSearch.astro": "./DocSearch.astro", 25 | "./schema": "./schema.ts" 26 | }, 27 | "peerDependencies": { 28 | "@astrojs/starlight": ">=0.32.0" 29 | }, 30 | "dependencies": { 31 | "@docsearch/css": "^3.6.0", 32 | "@docsearch/js": "^3.6.0" 33 | }, 34 | "devDependencies": { 35 | "@astrojs/starlight": "workspace:*" 36 | }, 37 | "publishConfig": { 38 | "provenance": true 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /packages/docsearch/virtual.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'virtual:starlight/docsearch-config' { 2 | const DocSearchClientOptions: import('./index').DocSearchClientOptions; 3 | export default DocSearchClientOptions; 4 | } 5 | -------------------------------------------------------------------------------- /packages/file-icons-generator/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "starlight-file-icons-generator", 3 | "version": "0.1.0", 4 | "description": "Generates Starlight file icons based on the Seti UI theme", 5 | "private": true, 6 | "scripts": { 7 | "build": "tsx ." 8 | }, 9 | "license": "MIT", 10 | "dependencies": { 11 | "opentype.js": "^1.3.4", 12 | "tsx": "^4.15.2" 13 | }, 14 | "devDependencies": { 15 | "@types/opentype.js": "^1.3.8" 16 | }, 17 | "type": "module" 18 | } 19 | -------------------------------------------------------------------------------- /packages/markdoc/.npmignore: -------------------------------------------------------------------------------- 1 | __tests__/ 2 | -------------------------------------------------------------------------------- /packages/markdoc/Code.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { Code as Default } from '@astrojs/starlight/components'; 3 | 4 | interface Props { 5 | code: string; 6 | lang?: string; 7 | } 8 | 9 | /** 10 | * This component is a basic wrapper for the `` component from Starlight used for Markdoc 11 | * fenced code blocks that ensures that we do not pass any child content to the `` component 12 | * which is an usage not supported by Expressive Code and would throw an error. 13 | */ 14 | --- 15 | 16 | 17 | -------------------------------------------------------------------------------- /packages/markdoc/README.md: -------------------------------------------------------------------------------- 1 | # @astrojs/starlight-markdoc 2 | 3 | Markdoc preset for the [Starlight][starlight] documentation theme for [Astro][astro]. 4 | 5 | ## Documentation 6 | 7 | See the [Starlight Markdoc docs][docs] for how to use this preset. 8 | 9 | ## License 10 | 11 | MIT 12 | 13 | Copyright (c) 2024–present [Starlight contributors][contributors] 14 | 15 | [starlight]: https://starlight.astro.build/ 16 | [astro]: https://astro.build/ 17 | [docs]: https://starlight.astro.build/guides/authoring-content/#markdoc 18 | [contributors]: https://github.com/withastro/starlight/graphs/contributors 19 | -------------------------------------------------------------------------------- /packages/markdoc/components.ts: -------------------------------------------------------------------------------- 1 | export { default as Code } from './Code.astro'; 2 | export { default as Heading } from '@astrojs/starlight/components/AnchorHeading.astro'; 3 | -------------------------------------------------------------------------------- /packages/markdoc/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@astrojs/starlight-markdoc", 3 | "version": "0.4.0", 4 | "description": "Markdoc preset for the Starlight documentation theme for Astro", 5 | "author": "Chris Swithinbank ", 6 | "license": "MIT", 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/withastro/starlight", 10 | "directory": "packages/markdoc" 11 | }, 12 | "bugs": "https://github.com/withastro/starlight/issues", 13 | "homepage": "https://starlight.astro.build", 14 | "type": "module", 15 | "exports": { 16 | ".": "./index.mjs", 17 | "./components": "./components.ts" 18 | }, 19 | "devDependencies": { 20 | "@astrojs/markdoc": "^0.13.3", 21 | "@astrojs/starlight": "workspace:*", 22 | "vitest": "^3.0.5" 23 | }, 24 | "peerDependencies": { 25 | "@astrojs/markdoc": ">=0.12.1", 26 | "@astrojs/starlight": ">=0.34.0" 27 | }, 28 | "publishConfig": { 29 | "provenance": true 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /packages/starlight/.gitignore: -------------------------------------------------------------------------------- 1 | # Astro generates this during tests, but we want to ignore it. 2 | env.d.ts 3 | __tests__/**/types.d.ts 4 | .astro 5 | -------------------------------------------------------------------------------- /packages/starlight/.npmignore: -------------------------------------------------------------------------------- 1 | # Vitest 2 | __coverage__/ 3 | __tests__/ 4 | __e2e__/ 5 | vitest.* 6 | playwright.config.ts 7 | # Astro generates this during tests, but we want to ignore it. 8 | src/env.d.ts 9 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/.gitignore: -------------------------------------------------------------------------------- 1 | # generated types 2 | .astro/ 3 | dist/ 4 | build/ 5 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/collection-config.test.ts: -------------------------------------------------------------------------------- 1 | import { expect, testFactory } from './test-utils'; 2 | 3 | // This fixture contains a space in the directory so that we have a smoke test for building 4 | // Starlight projects with pathnames like this, which are a common source of bugs. 5 | const test = testFactory('./fixtures/custom src-dir/'); 6 | 7 | test('builds a custom page using the `` component and a custom `srcDir`', async ({ 8 | page, 9 | getProdServer, 10 | }) => { 11 | const starlight = await getProdServer(); 12 | await starlight.goto('/custom'); 13 | 14 | await expect(page.getByText('Hello')).toBeVisible(); 15 | }); 16 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/basics/astro.config.mjs: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import starlight from '@astrojs/starlight'; 3 | import { defineConfig } from 'astro/config'; 4 | 5 | export default defineConfig({ 6 | integrations: [ 7 | starlight({ 8 | title: 'Basics', 9 | pagefind: false, 10 | }), 11 | ], 12 | }); 13 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/basics/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@e2e/basics", 3 | "version": "0.0.0", 4 | "private": true, 5 | "dependencies": { 6 | "@astrojs/starlight": "workspace:*", 7 | "astro": "^5.6.1" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/basics/src/components/PurpleCard.astro: -------------------------------------------------------------------------------- 1 |
    I am a purple card with white text.
    2 | 3 | 9 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/basics/src/components/Test.astro: -------------------------------------------------------------------------------- 1 | --- 2 | interface Props { 3 | id: string; 4 | } 5 | 6 | const { id } = Astro.props; 7 | --- 8 | 9 |
    10 | 11 |
    12 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/basics/src/content.config.ts: -------------------------------------------------------------------------------- 1 | import { defineCollection, z } from 'astro:content'; 2 | import { docsLoader } from '@astrojs/starlight/loaders'; 3 | import { docsSchema } from '@astrojs/starlight/schema'; 4 | import { glob } from 'astro/loaders'; 5 | 6 | export const collections = { 7 | docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }), 8 | // A collection not handled by Starlight. 9 | reviews: defineCollection({ 10 | loader: glob({ base: './src/content/reviews', pattern: `**/[^_]*.{md,mdx}` }), 11 | schema: z.object({ title: z.string() }), 12 | }), 13 | }; 14 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/basics/src/content/docs/anchor-heading-component.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Anchor Headings Component 3 | --- 4 | 5 | import AnchorHeading from '@astrojs/starlight/components/AnchorHeading.astro'; 6 | 7 | An anchor heading 8 | 9 | Another anchor heading 10 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/basics/src/content/docs/anchor-heading.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Anchor Headings 3 | --- 4 | 5 | ## An anchor heading 6 | 7 | ### Another anchor heading 8 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/basics/src/content/docs/head-propagation.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Head Propagation 3 | --- 4 | 5 | import PurpleCard from '../../components/PurpleCard.astro'; 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/basics/src/content/docs/tabs-unsynced.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Tabs unsynced 3 | --- 4 | 5 | import { Tabs, TabItem } from '@astrojs/starlight/components'; 6 | 7 | A basic set of tabs. 8 | 9 | 10 | npm command 11 | pnpm command 12 | yarn command 13 | 14 | 15 | Another basic set of tabs. 16 | 17 | 18 | tab 1 19 | tab 2 20 | tab 3 21 | 22 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/basics/src/content/docs/whitespaces.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Whitespaces 3 | --- 4 | 5 | import { Badge, Icon } from '@astrojs/starlight/components'; 6 | import Test from '../../components/Test.astro'; 7 | 8 | 9 | Badge () 10 | 11 | 12 | 13 | Icon () 14 | 15 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/basics/src/content/reviews/alice.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Review from Alice 3 | --- 4 | 5 | # Review from Alice 6 | 7 | This is a review from Alice. 8 | 9 | ## Description 10 | 11 | This content collection entry is not part of the Starlight `docs` collection. 12 | It is used to test that anchor links for headings are not generated for non-docs collection entries. 13 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/basics/src/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/basics/src/pages/[...param].astro: -------------------------------------------------------------------------------- 1 | --- 2 | import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro'; 3 | 4 | /** 5 | * The name of this dynamic route is intentionally set to `[...param]` to test a head propagation 6 | * issue that occurs for dynamic routes alphabetically sorted before the Starlight default route 7 | * (`[...slug]`) rendering the `` component. 8 | */ 9 | 10 | export function getStaticPaths() { 11 | return [{ params: { param: 'custom-page' } }]; 12 | } 13 | --- 14 | 15 | 16 |

    This is a custom page

    17 |
    18 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/basics/src/pages/markdown-page.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Individual Markdown Page 3 | --- 4 | 5 | # Individual Markdown Page 6 | 7 | ## Description 8 | 9 | This page is an [individual Markdown page](https://docs.astro.build/en/guides/markdown-content/#individual-markdown-pages). 10 | It is used to test that anchor links for headings are not generated for individual Markdown pages. 11 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/basics/src/pages/reviews/[...review].astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { getEntry, render } from 'astro:content'; 3 | 4 | /** 5 | * This route is used to test that anchor links for headings are not generated for non-docs 6 | * collection entries. 7 | */ 8 | 9 | export function getStaticPaths() { 10 | return [{ params: { review: 'alice' } }]; 11 | } 12 | 13 | // @ts-expect-error - we don't generate types for this test fixture before type-checking the entire 14 | // project. 15 | const entry = await getEntry('reviews', 'alice'); 16 | if (!entry) throw new Error('Could not find Alice review entry.'); 17 | 18 | const { Content } = await render(entry); 19 | --- 20 | 21 | 22 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/custom src-dir/astro.config.mjs: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import starlight from '@astrojs/starlight'; 3 | import { defineConfig } from 'astro/config'; 4 | 5 | export default defineConfig({ 6 | srcDir: './www', 7 | integrations: [ 8 | starlight({ 9 | title: 'Custom src directory', 10 | pagefind: false, 11 | }), 12 | ], 13 | }); 14 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/custom src-dir/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@e2e/custom-src-dir", 3 | "version": "0.0.0", 4 | "private": true, 5 | "dependencies": { 6 | "@astrojs/starlight": "workspace:*", 7 | "astro": "^5.6.1" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/custom src-dir/www/content.config.ts: -------------------------------------------------------------------------------- 1 | import { defineCollection } from 'astro:content'; 2 | import { docsLoader } from '@astrojs/starlight/loaders'; 3 | import { docsSchema } from '@astrojs/starlight/schema'; 4 | 5 | export const collections = { 6 | docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }), 7 | }; 8 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/custom src-dir/www/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/custom src-dir/www/pages/custom.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro'; 3 | --- 4 | 5 | 6 |

    Hello

    7 |
    8 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/git/.gitignore: -------------------------------------------------------------------------------- 1 | # This fixture is used for the E2E tests related to Git where 2 | # a new repo is created. Nested repos do not inherit the .gitignore 3 | # options from the parent repo, so even though these files are 4 | # already ignored on the package they have to be re-declared here. 5 | # Do not delete this file or the Git tests will try to index and 6 | # and commit all the node_modules and generated files from the test. 7 | env.d.ts 8 | .astro 9 | /node_modules/ 10 | /dist/ 11 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/git/astro.config.mjs: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import starlight from '@astrojs/starlight'; 3 | import { defineConfig } from 'astro/config'; 4 | 5 | export default defineConfig({ 6 | integrations: [ 7 | starlight({ 8 | title: 'Git', 9 | pagefind: false, 10 | }), 11 | ], 12 | }); 13 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/git/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@e2e/git", 3 | "version": "0.0.0", 4 | "private": true, 5 | "dependencies": { 6 | "@astrojs/starlight": "workspace:*", 7 | "astro": "^5.6.1" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/git/src/content.config.ts: -------------------------------------------------------------------------------- 1 | import { defineCollection } from 'astro:content'; 2 | import { docsLoader } from '@astrojs/starlight/loaders'; 3 | import { docsSchema } from '@astrojs/starlight/schema'; 4 | 5 | export const collections = { 6 | docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }), 7 | }; 8 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/git/src/content/docs/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Home Page 3 | lastUpdated: true 4 | --- 5 | 6 | Home page content 7 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/legacy-collection-config-file/astro.config.mjs: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import starlight from '@astrojs/starlight'; 3 | import { defineConfig } from 'astro/config'; 4 | 5 | export default defineConfig({ 6 | integrations: [ 7 | starlight({ 8 | title: 'Legacy collection config file', 9 | pagefind: false, 10 | }), 11 | ], 12 | }); 13 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/legacy-collection-config-file/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@e2e/legacy-collection-config-file", 3 | "version": "0.0.0", 4 | "private": true, 5 | "dependencies": { 6 | "@astrojs/starlight": "workspace:*", 7 | "astro": "^5.6.1" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/legacy-collection-config-file/src/content/config.ts: -------------------------------------------------------------------------------- 1 | import { defineCollection } from 'astro:content'; 2 | import { docsLoader } from '@astrojs/starlight/loaders'; 3 | import { docsSchema } from '@astrojs/starlight/schema'; 4 | 5 | export const collections = { 6 | docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }), 7 | }; 8 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/legacy-collection-config-file/src/pages/custom.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro'; 3 | --- 4 | 5 | 6 |

    Hello

    7 |
    8 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/ssr/astro.config.mjs: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import { defineConfig } from 'astro/config'; 3 | import starlight from '@astrojs/starlight'; 4 | import node from '@astrojs/node'; 5 | 6 | const prerendering = process.env.STARLIGHT_PRERENDER === 'yes'; 7 | 8 | export default defineConfig({ 9 | output: 'server', 10 | adapter: node({ mode: 'standalone' }), 11 | compressHTML: false, // for easier debugging 12 | // Output to different folders and expose on different ports 13 | // on each case so the servers don't conflict with 14 | // each other during tests. 15 | outDir: prerendering ? 'dist' : 'build', 16 | server: { 17 | port: prerendering ? 4322 : 4321, 18 | }, 19 | integrations: [ 20 | starlight({ 21 | title: 'SSR', 22 | prerender: prerendering, 23 | pagefind: false, 24 | }), 25 | ], 26 | }); 27 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/ssr/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@e2e/ssr", 3 | "version": "0.0.0", 4 | "private": true, 5 | "dependencies": { 6 | "@astrojs/node": "^9.0.0", 7 | "@astrojs/starlight": "workspace:*", 8 | "astro": "^5.6.1" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/ssr/src/component/ServerCheck.astro: -------------------------------------------------------------------------------- 1 | --- 2 | function checkServer() { 3 | try { 4 | Astro.clientAddress; 5 | 6 | return true; 7 | } catch { 8 | // Accessing `clientAddress` during build time 9 | // fails, so it is not SSR. 10 | return false; 11 | } 12 | } 13 | --- 14 | 15 |
    {checkServer() ? 'On server' : 'Not server'}
    16 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/ssr/src/content.config.ts: -------------------------------------------------------------------------------- 1 | import { defineCollection } from 'astro:content'; 2 | import { docsLoader } from '@astrojs/starlight/loaders'; 3 | import { docsSchema } from '@astrojs/starlight/schema'; 4 | 5 | export const collections = { 6 | docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }), 7 | }; 8 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/ssr/src/content/docs/404.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Not Found 3 | template: splash 4 | lastUpdate: true 5 | --- 6 | 7 | import ServerCheck from '../../component/ServerCheck.astro'; 8 | 9 | 10 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/ssr/src/content/docs/content.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Content 3 | lastUpdate: true 4 | --- 5 | 6 | Example page 7 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/ssr/src/content/docs/demo.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Server Check 3 | lastUpdate: true 4 | --- 5 | 6 | import ServerCheck from '../../component/ServerCheck.astro'; 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/ssr/src/content/docs/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Home Page 3 | template: splash 4 | lastUpdate: true 5 | hero: 6 | title: Make your docs shine with Starlight 7 | tagline: Everything you need to build a stellar documentation website. Fast, accessible, and easy-to-use. 8 | actions: 9 | - text: Get started 10 | icon: right-arrow 11 | variant: primary 12 | link: /getting-started/ 13 | - text: View on GitHub 14 | icon: external 15 | link: https://github.com/withastro/starlight 16 | --- 17 | 18 | Home page content 19 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/fixtures/ssr/src/middleware.ts: -------------------------------------------------------------------------------- 1 | import { defineMiddleware } from 'astro:middleware'; 2 | 3 | export const onRequest = defineMiddleware((context, next) => { 4 | if (context.url.pathname === '/content') { 5 | return context.rewrite('/demo'); 6 | } 7 | return next(); 8 | }); 9 | -------------------------------------------------------------------------------- /packages/starlight/__e2e__/legacy-collection-config-file.test.ts: -------------------------------------------------------------------------------- 1 | import { expect, testFactory } from './test-utils'; 2 | 3 | // This fixture uses a legacy collection config file (`src/content/config.ts`) instead of the new 4 | // one (`src/content.config.ts`). 5 | const test = testFactory('./fixtures/legacy-collection-config-file/'); 6 | 7 | test('builds a custom page using the `` component and a legacy collection config file', async ({ 8 | page, 9 | getProdServer, 10 | }) => { 11 | const starlight = await getProdServer(); 12 | await starlight.goto('/custom'); 13 | 14 | await expect(page.getByText('Hello')).toBeVisible(); 15 | }); 16 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/basics/config.test.ts: -------------------------------------------------------------------------------- 1 | import config from 'virtual:starlight/user-config'; 2 | import { expect, test } from 'vitest'; 3 | 4 | test('test suite is using correct env', () => { 5 | expect(config.title).toMatchObject({ en: 'Basics' }); 6 | }); 7 | 8 | test('isMultilingual is false when no locales configured ', () => { 9 | expect(config.locales).toBeUndefined(); 10 | expect(config.isMultilingual).toBe(false); 11 | }); 12 | 13 | test('default locale is set when no locales configured', () => { 14 | expect(config.defaultLocale).not.toBeUndefined(); 15 | expect(config.defaultLocale.lang).toBe('en'); 16 | expect(config.defaultLocale.label).toBe('English'); 17 | expect(config.defaultLocale.dir).toBe('ltr'); 18 | }); 19 | 20 | test('lastUpdated defaults to false', () => { 21 | expect(config.lastUpdated).toBe(false); 22 | }); 23 | 24 | test('favicon defaults to the provided SVG icon', () => { 25 | expect(config.favicon.href).toBe('/favicon.svg'); 26 | expect(config.favicon.type).toBe('image/svg+xml'); 27 | }); 28 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/basics/localizedUrl.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, expect, test } from 'vitest'; 2 | import { localizedUrl } from '../../utils/localizedUrl'; 3 | 4 | describe('with `build.output: "directory"`', () => { 5 | test('it has no effect in a monolingual project', () => { 6 | const url = new URL('https://example.com/en/guide/'); 7 | expect(localizedUrl(url, undefined, 'ignore').href).toBe(url.href); 8 | }); 9 | 10 | test('has no effect on index route in a monolingual project', () => { 11 | const url = new URL('https://example.com/'); 12 | expect(localizedUrl(url, undefined, 'ignore').href).toBe(url.href); 13 | }); 14 | }); 15 | 16 | describe('with `build.output: "file"`', () => { 17 | test('it has no effect in a monolingual project', () => { 18 | const url = new URL('https://example.com/en/guide.html'); 19 | expect(localizedUrl(url, undefined, 'ignore').href).toBe(url.href); 20 | }); 21 | 22 | test('has no effect on index route in a monolingual project', () => { 23 | const url = new URL('https://example.com/index.html'); 24 | expect(localizedUrl(url, undefined, 'ignore').href).toBe(url.href); 25 | }); 26 | }); 27 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/basics/sorting.test.ts: -------------------------------------------------------------------------------- 1 | import { expect, test, vi } from 'vitest'; 2 | import { flattenSidebar, getSidebar } from '../../utils/navigation'; 3 | 4 | vi.mock('astro:content', async () => 5 | (await import('../test-utils')).mockedAstroContent({ 6 | docs: [ 7 | ['index.mdx', { title: 'first' }], 8 | ['guides/example.md', { title: 'second' }], 9 | ['reference/example.md', { title: 'third' }], 10 | ['reference/rod/foo.md', { title: 'fourth' }], 11 | ['reference/rod/zip.md', { title: 'fifth' }], 12 | ['reference/zoo.md', { title: 'sixth' }], 13 | ], 14 | }) 15 | ); 16 | 17 | test('autogenerated sidebar is sorted alphabetically by filename', () => { 18 | const sidebar = getSidebar('/', undefined); 19 | const flattened = flattenSidebar(sidebar); 20 | 21 | expect(flattened.map((e) => e.label)).toMatchInlineSnapshot(` 22 | [ 23 | "first", 24 | "second", 25 | "third", 26 | "fourth", 27 | "fifth", 28 | "sixth", 29 | ] 30 | `); 31 | }); 32 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/basics/user-config.test.ts: -------------------------------------------------------------------------------- 1 | import { expect, test } from 'vitest'; 2 | import { StarlightConfigSchema } from '../../utils/user-config'; 3 | 4 | test('preserve social config order', () => { 5 | const config = StarlightConfigSchema.parse({ 6 | title: 'Test', 7 | social: [ 8 | { icon: 'twitch', label: 'Twitch', href: 'https://www.twitch.tv/bholmesdev' }, 9 | { icon: 'github', label: 'GitHub', href: 'https://github.com/withastro/starlight' }, 10 | { icon: 'discord', label: 'Discord', href: 'https://astro.build/chat' }, 11 | ], 12 | }); 13 | expect((config.social || []).map(({ icon }) => icon)).toEqual(['twitch', 'github', 'discord']); 14 | }); 15 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/basics/vitest.config.ts: -------------------------------------------------------------------------------- 1 | import { defineVitestConfig } from '../test-config'; 2 | 3 | export default defineVitestConfig({ title: 'Basics' }); 4 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/edit-url/vitest.config.ts: -------------------------------------------------------------------------------- 1 | import { defineVitestConfig } from '../test-config'; 2 | 3 | export default defineVitestConfig({ 4 | title: 'Docs With Edit Links', 5 | editLink: { 6 | baseUrl: 'https://github.com/withastro/starlight/edit/main/docs/', 7 | }, 8 | }); 9 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/head/vitest.config.ts: -------------------------------------------------------------------------------- 1 | import { defineVitestConfig } from '../test-config'; 2 | 3 | export default defineVitestConfig({ 4 | title: 'Docs With Custom Head', 5 | description: 'Docs with a custom head', 6 | head: [ 7 | { tag: 'link', attrs: { rel: 'canonical', href: 'https://example.com/test' } }, 8 | { tag: 'link', attrs: { rel: 'stylesheet', href: 'primary.css' } }, 9 | { tag: 'meta', attrs: { name: 'x', content: 'Default' } }, 10 | { tag: 'meta', attrs: { property: 'x', content: 'Default' } }, 11 | { tag: 'meta', attrs: { 'http-equiv': 'x', content: 'Default' } }, 12 | { 13 | tag: 'script', 14 | attrs: { 15 | src: 'https://example.com/analytics', 16 | 'data-site': 'TEST-ANALYTICS-ID', 17 | defer: true, 18 | }, 19 | }, 20 | ], 21 | social: [{ icon: 'twitter', label: 'Twitter', href: 'https://twitter.com/astrodotbuild' }], 22 | }); 23 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/i18n-non-root-single-locale/config.test.ts: -------------------------------------------------------------------------------- 1 | import config from 'virtual:starlight/user-config'; 2 | import { expect, test } from 'vitest'; 3 | 4 | test('test suite is using correct env', () => { 5 | expect(config.title).toMatchObject({ 'fr-CA': 'i18n with a non-root single locale' }); 6 | }); 7 | 8 | test('config.isMultilingual is false with a single locale', () => { 9 | expect(config.isMultilingual).toBe(false); 10 | expect(config.locales).keys('fr'); 11 | }); 12 | 13 | test('config.defaultLocale is populated from default locale', () => { 14 | expect(config.defaultLocale.lang).toBe('fr-CA'); 15 | expect(config.defaultLocale.dir).toBe('ltr'); 16 | expect(config.defaultLocale.locale).toBe('fr'); 17 | }); 18 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/i18n-non-root-single-locale/src/content/i18n/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "page.editLink": "Changer cette page" 3 | } 4 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/i18n-non-root-single-locale/translations-with-user-config.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, expect, test, vi } from 'vitest'; 2 | import translations from '../../translations'; 3 | import { useTranslations } from '../../utils/translations'; 4 | 5 | vi.mock('astro:content', async () => 6 | (await import('../test-utils')).mockedAstroContent({ 7 | i18n: [['fr-CA', { 'page.editLink': 'Modifier cette doc!' }]], 8 | }) 9 | ); 10 | 11 | describe('useTranslations()', () => { 12 | test('uses user-defined translations', () => { 13 | const t = useTranslations('fr'); 14 | expect(t('page.editLink')).toBe('Modifier cette doc!'); 15 | expect(t('page.editLink')).not.toBe(translations.fr?.['page.editLink']); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/i18n-non-root-single-locale/translations.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, expect, test } from 'vitest'; 2 | import translations from '../../translations'; 3 | import { useTranslations } from '../../utils/translations'; 4 | 5 | describe('built-in translations', () => { 6 | test('includes French', () => { 7 | expect(translations).toHaveProperty('fr'); 8 | }); 9 | }); 10 | 11 | describe('useTranslations()', () => { 12 | test('works when no i18n collection is available', () => { 13 | const t = useTranslations('fr'); 14 | expect(t).toBeTypeOf('function'); 15 | expect(t('page.editLink')).toBe(translations.fr?.['page.editLink']); 16 | }); 17 | 18 | test('returns default locale for unknown language', () => { 19 | const locale = 'xx'; 20 | expect(translations).not.toHaveProperty(locale); 21 | const t = useTranslations(locale); 22 | expect(t('page.editLink')).toBe(translations.fr?.['page.editLink']); 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/i18n-non-root-single-locale/vitest.config.ts: -------------------------------------------------------------------------------- 1 | import { defineVitestConfig } from '../test-config'; 2 | 3 | export default defineVitestConfig({ 4 | title: 'i18n with a non-root single locale', 5 | defaultLocale: 'fr', 6 | locales: { 7 | fr: { label: 'Français', lang: 'fr-CA' }, 8 | }, 9 | }); 10 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/i18n-root-locale/config.test.ts: -------------------------------------------------------------------------------- 1 | import config from 'virtual:starlight/user-config'; 2 | import { expect, test } from 'vitest'; 3 | 4 | test('test suite is using correct env', () => { 5 | expect(config.title).toMatchObject({ fr: 'i18n with root locale' }); 6 | }); 7 | 8 | test('config.isMultilingual is true with multiple locales', () => { 9 | expect(config.isMultilingual).toBe(true); 10 | expect(config.locales).keys('root', 'en', 'ar'); 11 | }); 12 | 13 | test('config.defaultLocale is populated from root locale', () => { 14 | expect(config.defaultLocale.lang).toBe('fr'); 15 | expect(config.defaultLocale.dir).toBe('ltr'); 16 | expect(config.defaultLocale.locale).toBeUndefined(); 17 | }); 18 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/i18n-root-locale/vitest.config.ts: -------------------------------------------------------------------------------- 1 | import { defineVitestConfig } from '../test-config'; 2 | 3 | export default defineVitestConfig({ 4 | title: 'i18n with root locale', 5 | locales: { 6 | root: { label: 'French', lang: 'fr' }, 7 | en: { label: 'English', lang: 'en-US' }, 8 | ar: { label: 'Arabic', dir: 'rtl' }, 9 | }, 10 | }); 11 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/i18n-sidebar-badge-error/i18n-sidebar-badge-error.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, expect, test, vi } from 'vitest'; 2 | import { getSidebar } from '../../utils/navigation'; 3 | 4 | vi.mock('astro:content', async () => 5 | (await import('../test-utils')).mockedAstroContent({ 6 | docs: [['getting-started.mdx', { title: 'Getting Started' }]], 7 | }) 8 | ); 9 | 10 | describe('getSidebar', () => { 11 | test('throws an error if an i18n badge doesn’t have a key for the default language', () => { 12 | expect(() => getSidebar('/', undefined)).toThrowErrorMatchingInlineSnapshot(` 13 | "[AstroUserError]: 14 | The badge text for "Getting Started" must have a key for the default language "en-US". 15 | Hint: 16 | Update the Starlight config to include a badge text for the default language. 17 | Learn more about sidebar badges internationalization at https://starlight.astro.build/guides/sidebar/#internationalization-with-badges" 18 | `); 19 | }); 20 | }); 21 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/i18n-sidebar-badge-error/vitest.config.ts: -------------------------------------------------------------------------------- 1 | import { defineVitestConfig } from '../test-config'; 2 | 3 | export default defineVitestConfig({ 4 | title: 'i18n sidebar badge error', 5 | locales: { 6 | fr: { label: 'French' }, 7 | root: { label: 'English', lang: 'en-US' }, 8 | }, 9 | sidebar: [ 10 | { 11 | slug: 'getting-started', 12 | badge: { text: { fr: 'Nouveau' } }, 13 | }, 14 | ], 15 | }); 16 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/i18n-sidebar/vitest.config.ts: -------------------------------------------------------------------------------- 1 | import { defineVitestConfig } from '../test-config'; 2 | 3 | export default defineVitestConfig({ 4 | title: 'i18n sidebar', 5 | locales: { 6 | fr: { label: 'French' }, 7 | root: { label: 'English', lang: 'en-US' }, 8 | }, 9 | sidebar: [ 10 | { slug: 'index' }, 11 | 'getting-started', 12 | { 13 | slug: 'manual-setup', 14 | label: 'Do it yourself', 15 | translations: { fr: 'Fait maison' }, 16 | badge: { text: { 'en-US': 'New', fr: 'Nouveau' } }, 17 | }, 18 | { 19 | slug: 'environmental-impact', 20 | badge: { 21 | variant: 'success', 22 | text: { 'en-US': 'Eco-friendly', fr: 'Écologique' }, 23 | }, 24 | }, 25 | { 26 | label: 'Guides', 27 | items: [{ slug: 'guides/pages' }, { slug: 'guides/authoring-content', badge: 'Deprecated' }], 28 | }, 29 | 'resources/plugins', 30 | ], 31 | }); 32 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/i18n-single-root-locale/config.test.ts: -------------------------------------------------------------------------------- 1 | import config from 'virtual:starlight/user-config'; 2 | import { expect, test } from 'vitest'; 3 | 4 | test('test suite is using correct env', () => { 5 | expect(config.title).toMatchObject({ 'fr-CA': 'i18n with a single root locale' }); 6 | }); 7 | 8 | test('config.isMultilingual is false with a single root locale', () => { 9 | expect(config.isMultilingual).toBe(false); 10 | expect(config.locales).toBeUndefined(); 11 | }); 12 | 13 | test('config.defaultLocale is populated from the single root locale', () => { 14 | expect(config.defaultLocale.lang).toBe('fr-CA'); 15 | expect(config.defaultLocale.dir).toBe('ltr'); 16 | expect(config.defaultLocale.locale).toBeUndefined(); 17 | }); 18 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/i18n-single-root-locale/i18n.test.ts: -------------------------------------------------------------------------------- 1 | import { assert, describe, expect, test } from 'vitest'; 2 | import config from 'virtual:starlight/user-config'; 3 | import { processI18nConfig } from '../../utils/i18n'; 4 | 5 | describe('processI18nConfig', () => { 6 | test('returns the Astro i18n config for a monolingual site with a single root locale', () => { 7 | const { astroI18nConfig, starlightConfig } = processI18nConfig(config, undefined); 8 | 9 | expect(astroI18nConfig.defaultLocale).toBe('fr-CA'); 10 | expect(astroI18nConfig.locales).toEqual(['fr-CA']); 11 | assert(typeof astroI18nConfig.routing !== 'string'); 12 | expect(astroI18nConfig.routing?.prefixDefaultLocale).toBe(false); 13 | 14 | // The Starlight configuration should not be modified. 15 | expect(config).toStrictEqual(starlightConfig); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/i18n-single-root-locale/routing.test.ts: -------------------------------------------------------------------------------- 1 | import { expect, test, vi } from 'vitest'; 2 | import project from 'virtual:starlight/project-context'; 3 | import { routes } from '../../utils/routing'; 4 | 5 | vi.mock('astro:content', async () => 6 | (await import('../test-utils')).mockedAstroContent({ 7 | docs: [ 8 | ['index.mdx', { title: 'Accueil' }], 9 | ['guides/authoring-content.mdx', { title: 'Authoring content' }], 10 | ['en/index.mdx', { title: 'Not the home page' }], 11 | ], 12 | }) 13 | ); 14 | 15 | test('route slugs are normalized', () => { 16 | const indexRoute = routes.find( 17 | (route) => route.id === (project.legacyCollections ? 'index.mdx' : '') 18 | ); 19 | expect(indexRoute?.slug).toBe(''); 20 | }); 21 | 22 | test('routes have locale data added', () => { 23 | for (const route of routes) { 24 | expect(route.lang).toBe('fr-CA'); 25 | expect(route.dir).toBe('ltr'); 26 | expect(route.locale).toBeUndefined(); 27 | } 28 | }); 29 | 30 | test('does not mark any route as fallback routes', () => { 31 | const fallbacks = routes.filter((route) => route.isFallback); 32 | expect(fallbacks.length).toBe(0); 33 | }); 34 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/i18n-single-root-locale/src/content/i18n/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "page.editLink": "Changer cette page" 3 | } 4 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/i18n-single-root-locale/translations-with-user-config.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, expect, test, vi } from 'vitest'; 2 | import translations from '../../translations'; 3 | import { useTranslations } from '../../utils/translations'; 4 | 5 | vi.mock('astro:content', async () => 6 | (await import('../test-utils')).mockedAstroContent({ 7 | i18n: [['fr-CA', { 'page.editLink': 'Modifier cette doc!' }]], 8 | }) 9 | ); 10 | 11 | describe('useTranslations()', () => { 12 | test('uses user-defined translations', () => { 13 | const t = useTranslations('fr'); 14 | expect(t('page.editLink')).toBe('Modifier cette doc!'); 15 | expect(t('page.editLink')).not.toBe(translations.fr?.['page.editLink']); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/i18n-single-root-locale/translations.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, expect, test } from 'vitest'; 2 | import translations from '../../translations'; 3 | import { useTranslations } from '../../utils/translations'; 4 | 5 | describe('built-in translations', () => { 6 | test('includes French', () => { 7 | expect(translations).toHaveProperty('fr'); 8 | }); 9 | }); 10 | 11 | describe('useTranslations()', () => { 12 | test('works when no i18n collection is available', () => { 13 | const t = useTranslations('fr'); 14 | expect(t).toBeTypeOf('function'); 15 | expect(t('page.editLink')).toBe(translations.fr?.['page.editLink']); 16 | }); 17 | 18 | test('returns default locale for unknown language', () => { 19 | const locale = 'xx'; 20 | expect(translations).not.toHaveProperty(locale); 21 | const t = useTranslations(locale); 22 | expect(t('page.editLink')).toBe(translations.fr?.['page.editLink']); 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/i18n-single-root-locale/vitest.config.ts: -------------------------------------------------------------------------------- 1 | import { defineVitestConfig } from '../test-config'; 2 | 3 | export default defineVitestConfig({ 4 | title: 'i18n with a single root locale', 5 | locales: { 6 | root: { label: 'Français', lang: 'fr-CA' }, 7 | }, 8 | }); 9 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/i18n/config.test.ts: -------------------------------------------------------------------------------- 1 | import config from 'virtual:starlight/user-config'; 2 | import { expect, test } from 'vitest'; 3 | 4 | test('test suite is using correct env', () => { 5 | expect(config.title).toMatchObject({ 'en-US': 'i18n with no root locale' }); 6 | }); 7 | 8 | test('config.isMultilingual is true with multiple locales', () => { 9 | expect(config.isMultilingual).toBe(true); 10 | expect(config.locales).keys('fr', 'en', 'ar', 'pt-br'); 11 | }); 12 | 13 | test('config.defaultLocale is populated from the user’s chosen default', () => { 14 | expect(config.defaultLocale.locale).toBe('en'); 15 | expect(config.defaultLocale.lang).toBe('en-US'); 16 | expect(config.defaultLocale.dir).toBe('ltr'); 17 | }); 18 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/i18n/empty-src/content/i18n/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/packages/starlight/__tests__/i18n/empty-src/content/i18n/.gitkeep -------------------------------------------------------------------------------- /packages/starlight/__tests__/i18n/head.test.ts: -------------------------------------------------------------------------------- 1 | import { expect, test, vi } from 'vitest'; 2 | import config from 'virtual:starlight/user-config'; 3 | import { getRouteDataTestContext } from '../test-utils'; 4 | import { generateRouteData } from '../../utils/routing/data'; 5 | import { routes } from '../../utils/routing'; 6 | 7 | vi.mock('astro:content', async () => 8 | (await import('../test-utils')).mockedAstroContent({ 9 | docs: [['index.mdx', { title: 'Home Page' }]], 10 | }) 11 | ); 12 | 13 | test('includes links to language alternates', () => { 14 | const route = routes[0]!; 15 | const { head } = generateRouteData({ 16 | props: { ...route, headings: [] }, 17 | context: getRouteDataTestContext(), 18 | }); 19 | for (const [locale, localeConfig] of Object.entries(config.locales!)) { 20 | expect(head).toContainEqual({ 21 | tag: 'link', 22 | attrs: { 23 | rel: 'alternate', 24 | href: `https://example.com/${locale}/`, 25 | hreflang: localeConfig?.lang, 26 | }, 27 | }); 28 | } 29 | }); 30 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/i18n/malformed-json-src/content/i18n/en.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withastro/starlight/986576429763abf67c58e633ac075ecfd1d4d44c/packages/starlight/__tests__/i18n/malformed-json-src/content/i18n/en.json -------------------------------------------------------------------------------- /packages/starlight/__tests__/i18n/malformed-yaml-src/content/i18n/en.yml: -------------------------------------------------------------------------------- 1 | test: 'Malformed YAML file with dangling trailing comma', 2 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/i18n/src/content/i18n/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "page.editLink": "Make this page different" 3 | } 4 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/i18n/src/content/i18n/fr.yml: -------------------------------------------------------------------------------- 1 | page.editLink: Rendre cette page différente 2 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/i18n/translations-with-user-config.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, expect, test, vi } from 'vitest'; 2 | import translations from '../../translations'; 3 | import { useTranslations } from '../../utils/translations'; 4 | 5 | vi.mock('astro:content', async () => 6 | (await import('../test-utils')).mockedAstroContent({ 7 | i18n: [ 8 | ['en-US', { 'page.editLink': 'Modify this doc!' }], 9 | ['pt-BR', { 'page.editLink': 'Modifique esse doc!' }], 10 | ], 11 | }) 12 | ); 13 | 14 | describe('useTranslations()', () => { 15 | test('uses user-defined translations', () => { 16 | const t = useTranslations(undefined); 17 | expect(t('page.editLink')).toBe('Modify this doc!'); 18 | expect(t('page.editLink')).not.toBe(translations.en?.['page.editLink']); 19 | }); 20 | 21 | test('uses user-defined regional translations when available', () => { 22 | const t = useTranslations('pt-BR'); 23 | expect(t('page.editLink')).toBe('Modifique esse doc!'); 24 | expect(t('page.editLink')).not.toBe(translations.pt?.['page.editLink']); 25 | }); 26 | }); 27 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/i18n/vitest.config.ts: -------------------------------------------------------------------------------- 1 | import { defineVitestConfig } from '../test-config'; 2 | 3 | export default defineVitestConfig({ 4 | title: 'i18n with no root locale', 5 | defaultLocale: 'en', 6 | locales: { 7 | fr: { label: 'French' }, 8 | en: { label: 'English', lang: 'en-US' }, 9 | ar: { label: 'Arabic', dir: 'rtl' }, 10 | 'pt-br': { label: 'Brazilian Portuguese', lang: 'pt-BR' }, 11 | }, 12 | }); 13 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/middleware/vitest.config.ts: -------------------------------------------------------------------------------- 1 | import { defineVitestConfig } from '../test-config'; 2 | 3 | export default defineVitestConfig({ title: 'Middleware' }); 4 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/remark-rehype/code-rtl-support.test.ts: -------------------------------------------------------------------------------- 1 | import { rehype } from 'rehype'; 2 | import { expect, test } from 'vitest'; 3 | import { rehypeRtlCodeSupport } from '../../integrations/code-rtl-support'; 4 | 5 | const processor = rehype().data('settings', { fragment: true }).use(rehypeRtlCodeSupport()); 6 | 7 | test('applies `dir="auto"` to inline code', async () => { 8 | const input = `

    Some text with inline code.

    `; 9 | const output = String(await processor.process(input)); 10 | expect(output).not.toEqual(input); 11 | expect(output).includes('dir="auto"'); 12 | expect(output).toMatchInlineSnapshot( 13 | `"

    Some text with inline code.

    "` 14 | ); 15 | }); 16 | 17 | test('applies `dir="ltr"` to code blocks', async () => { 18 | const input = `

    Some text in a paragraph:

    console.log('test')
    `; 19 | const output = String(await processor.process(input)); 20 | expect(output).not.toEqual(input); 21 | expect(output).includes('dir="ltr"'); 22 | expect(output).toMatchInlineSnapshot( 23 | `"

    Some text in a paragraph:

    console.log('test')
    "` 24 | ); 25 | }); 26 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/remark-rehype/snapshots/file-tree-basic.html: -------------------------------------------------------------------------------- 1 |
      2 |
    • root_file
    • 3 |
    • Directoryroot_directory/ 4 |
        5 |
      • nested_file
      • 6 |
      7 |
    -------------------------------------------------------------------------------- /packages/starlight/__tests__/remark-rehype/snapshots/file-tree-comment-nodes.html: -------------------------------------------------------------------------------- 1 |
    • file this is an important comment
    -------------------------------------------------------------------------------- /packages/starlight/__tests__/remark-rehype/snapshots/file-tree-comment-text.html: -------------------------------------------------------------------------------- 1 |
    • file this is a comment
    -------------------------------------------------------------------------------- /packages/starlight/__tests__/remark-rehype/snapshots/generates-anchor-link-markup.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/remark-rehype/vitest.config.ts: -------------------------------------------------------------------------------- 1 | import { defineVitestConfig } from '../test-config'; 2 | 3 | export default defineVitestConfig({ title: 'Remark-Rehype' }); 4 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/sidebar-slug-error/sidebar-slug-error.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, expect, test, vi } from 'vitest'; 2 | import { getSidebar } from '../../utils/navigation'; 3 | 4 | vi.mock('astro:content', async () => 5 | (await import('../test-utils')).mockedAstroContent({ 6 | docs: [['getting-started.mdx', { title: 'Getting Started' }]], 7 | }) 8 | ); 9 | 10 | describe('getSidebar', () => { 11 | test('throws an error if slug doesn’t match a content collection entry', () => { 12 | expect(() => getSidebar('/', undefined)).toThrowErrorMatchingInlineSnapshot(` 13 | "[AstroUserError]: 14 | The slug \`"/getting-started/"\` specified in the Starlight sidebar config must not start or end with a slash. 15 | Hint: 16 | Please try updating \`"/getting-started/"\` to \`"getting-started"\`." 17 | `); 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/sidebar-slug-error/vitest.config.ts: -------------------------------------------------------------------------------- 1 | import { defineVitestConfig } from '../test-config'; 2 | 3 | export default defineVitestConfig({ 4 | title: 'sidebar slug error', 5 | sidebar: ['/getting-started/'], 6 | }); 7 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/snapshot-serializer-astro-error.ts: -------------------------------------------------------------------------------- 1 | import { AstroError } from 'astro/errors'; 2 | import type { SnapshotSerializer } from 'vitest'; 3 | 4 | export default { 5 | /** Check if a value should be handled by this serializer, i.e. if it is an `AstroError`. */ 6 | test(val) { 7 | return !!val && AstroError.is(val); 8 | }, 9 | /** Customize serialization of Astro errors to include the `hint`. Vitest only uses `message` by default. */ 10 | serialize({ name, message, hint }: AstroError, config, indentation, depth, refs, printer) { 11 | const prettyError = `[${name}]:\n${indent(message)}\nHint:\n${indent(hint)}`; 12 | return printer(prettyError, config, indentation, depth, refs); 13 | }, 14 | } satisfies SnapshotSerializer; 15 | 16 | /** Indent each line in `string` with a given character. */ 17 | function indent(string = '', indentation = '\t') { 18 | return string 19 | .split('\n') 20 | .map((line) => indentation + line) 21 | .join('\n'); 22 | } 23 | -------------------------------------------------------------------------------- /packages/starlight/__tests__/test-plugin-utils.ts: -------------------------------------------------------------------------------- 1 | import type { AstroIntegrationLogger } from 'astro'; 2 | import { type StarlightPluginContext } from '../utils/plugins'; 3 | 4 | export function createTestPluginContext(): StarlightPluginContext { 5 | return { 6 | command: 'dev', 7 | // @ts-expect-error - we don't provide a full Astro config but only what is needed for the 8 | // plugins to run. 9 | config: { srcDir: new URL('./src/', import.meta.url), integrations: [] }, 10 | isRestart: false, 11 | logger: new TestAstroIntegrationLogger(), 12 | }; 13 | } 14 | 15 | class TestAstroIntegrationLogger { 16 | options = {} as AstroIntegrationLogger['options']; 17 | constructor(public label = 'test-integration-logger') {} 18 | fork = (label: string) => new TestAstroIntegrationLogger(label); 19 | info = () => undefined; 20 | warn = () => undefined; 21 | error = () => undefined; 22 | debug = () => undefined; 23 | } 24 | -------------------------------------------------------------------------------- /packages/starlight/components.ts: -------------------------------------------------------------------------------- 1 | export { default as Aside } from './user-components/Aside.astro'; 2 | export { default as Badge } from './user-components/Badge.astro'; 3 | export { default as Card } from './user-components/Card.astro'; 4 | export { default as CardGrid } from './user-components/CardGrid.astro'; 5 | export { default as Icon } from './user-components/Icon.astro'; 6 | export { default as Tabs } from './user-components/Tabs.astro'; 7 | export { default as TabItem } from './user-components/TabItem.astro'; 8 | export { default as LinkCard } from './user-components/LinkCard.astro'; 9 | export { default as Steps } from './user-components/Steps.astro'; 10 | export { default as FileTree } from './user-components/FileTree.astro'; 11 | export { default as LinkButton } from './user-components/LinkButton.astro'; 12 | export { Code } from 'astro-expressive-code/components'; 13 | -------------------------------------------------------------------------------- /packages/starlight/components/Banner.astro: -------------------------------------------------------------------------------- 1 | --- 2 | const { banner } = Astro.locals.starlightRoute.entry.data; 3 | --- 4 | 5 | {banner &&
    } 6 | 7 | 24 | -------------------------------------------------------------------------------- /packages/starlight/components/ContentNotice.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import type { StarlightIcon } from '../components/Icons'; 3 | import Icon from '../user-components/Icon.astro'; 4 | 5 | interface Props { 6 | icon: StarlightIcon; 7 | label: string; 8 | } 9 | 10 | const { icon, label } = Astro.props; 11 | --- 12 | 13 |

    14 | 15 | {label} 16 |

    17 | 18 | 34 | -------------------------------------------------------------------------------- /packages/starlight/components/ContentPanel.astro: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 | 5 | 28 | -------------------------------------------------------------------------------- /packages/starlight/components/DraftContentNotice.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import ContentNotice from './ContentNotice.astro'; 3 | --- 4 | 5 | 6 | -------------------------------------------------------------------------------- /packages/starlight/components/EditLink.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import Icon from '../user-components/Icon.astro'; 3 | 4 | const { editUrl } = Astro.locals.starlightRoute; 5 | --- 6 | 7 | { 8 | editUrl && ( 9 | 10 | 11 | {Astro.locals.t('page.editLink')} 12 | 13 | ) 14 | } 15 | 16 | 29 | -------------------------------------------------------------------------------- /packages/starlight/components/FallbackContentNotice.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import ContentNotice from './ContentNotice.astro'; 3 | --- 4 | 5 | 6 | -------------------------------------------------------------------------------- /packages/starlight/components/Head.astro: -------------------------------------------------------------------------------- 1 | --- 2 | const { head } = Astro.locals.starlightRoute; 3 | --- 4 | 5 | {head.map(({ tag: Tag, attrs, content }) => )} 6 | -------------------------------------------------------------------------------- /packages/starlight/components/LastUpdated.astro: -------------------------------------------------------------------------------- 1 | --- 2 | const { lang, lastUpdated } = Astro.locals.starlightRoute; 3 | --- 4 | 5 | { 6 | lastUpdated && ( 7 |

    8 | {Astro.locals.t('page.lastUpdated')}{' '} 9 | 12 |

    13 | ) 14 | } 15 | -------------------------------------------------------------------------------- /packages/starlight/components/MarkdownContent.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import '../style/markdown.css'; 3 | --- 4 | 5 |
    6 | -------------------------------------------------------------------------------- /packages/starlight/components/MobileMenuFooter.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import LanguageSelect from 'virtual:starlight/components/LanguageSelect'; 3 | import SocialIcons from 'virtual:starlight/components/SocialIcons'; 4 | import ThemeSelect from 'virtual:starlight/components/ThemeSelect'; 5 | --- 6 | 7 |
    8 | 11 | 12 | 13 |
    14 | 15 | 36 | -------------------------------------------------------------------------------- /packages/starlight/components/PageTitle.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { PAGE_TITLE_ID } from '../constants'; 3 | --- 4 | 5 |

    {Astro.locals.starlightRoute.entry.data.title}

    6 | 7 | 18 | -------------------------------------------------------------------------------- /packages/starlight/components/Sidebar.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import MobileMenuFooter from 'virtual:starlight/components/MobileMenuFooter'; 3 | import SidebarPersister from './SidebarPersister.astro'; 4 | import SidebarSublist from './SidebarSublist.astro'; 5 | 6 | const { sidebar } = Astro.locals.starlightRoute; 7 | --- 8 | 9 | 10 | 11 | 12 | 13 |
    14 | 15 |
    16 | -------------------------------------------------------------------------------- /packages/starlight/components/SidebarRestorePoint.astro: -------------------------------------------------------------------------------- 1 | --- 2 | /** Unique symbol for storing a running index in `locals`. */ 3 | const currentGroupIndexSymbol = Symbol.for('starlight-sidebar-group-index'); 4 | const locals = Astro.locals as App.Locals & { [currentGroupIndexSymbol]: number }; 5 | 6 | /** The current sidebar group’s index retrieved from `locals` if set, starting at `0`. */ 7 | const index = locals[currentGroupIndexSymbol] || 0; 8 | // Increment the index for the next instance. 9 | locals[currentGroupIndexSymbol] = index + 1; 10 | --- 11 | 12 | 13 | -------------------------------------------------------------------------------- /packages/starlight/components/SkipLink.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { PAGE_TITLE_ID } from '../constants'; 3 | --- 4 | 5 | {Astro.locals.t('skipLink.label')} 6 | 7 | 27 | -------------------------------------------------------------------------------- /packages/starlight/components/SocialIcons.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import config from 'virtual:starlight/user-config'; 3 | import Icon from '../user-components/Icon.astro'; 4 | 5 | const links = config.social || []; 6 | --- 7 | 8 | { 9 | links.length > 0 && ( 10 | <> 11 | {links.map(({ label, href, icon }) => ( 12 | 13 | {label} 14 | 15 | 16 | ))} 17 | 18 | ) 19 | } 20 | 21 | 33 | -------------------------------------------------------------------------------- /packages/starlight/components/StarlightPage.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import { attachRouteDataAndRunMiddleware } from '../utils/routing/middleware'; 3 | import { 4 | generateStarlightPageRouteData, 5 | type StarlightPageProps as Props, 6 | } from '../utils/starlight-page'; 7 | import Page from './Page.astro'; 8 | 9 | export type StarlightPageProps = Props; 10 | 11 | await attachRouteDataAndRunMiddleware( 12 | Astro, 13 | await generateStarlightPageRouteData({ props: Astro.props, context: Astro }) 14 | ); 15 | --- 16 | 17 | 18 | -------------------------------------------------------------------------------- /packages/starlight/components/TableOfContents.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import TableOfContentsList from './TableOfContents/TableOfContentsList.astro'; 3 | 4 | const { toc } = Astro.locals.starlightRoute; 5 | --- 6 | 7 | { 8 | toc && ( 9 | 10 | 14 | 15 | ) 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /packages/starlight/constants.ts: -------------------------------------------------------------------------------- 1 | // N.B. THIS FILE IS IMPORTED IN BOTH SERVER- AND CLIENT-SIDE CODE. 2 | // THINK TWICE BEFORE ADDING STUFF AS IT WILL GET SHIPPED TO THE CLIENT. 3 | 4 | export const PAGE_TITLE_ID = '_top'; 5 | -------------------------------------------------------------------------------- /packages/starlight/expressive-code.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @file This file is exported by Starlight as `@astrojs/starlight/expressive-code`. 3 | * 4 | * It is required by the `` component to access the same configuration preprocessor 5 | * function as the one used by the integration. 6 | * 7 | * It also provides access to all of the Expressive Code classes and functions without having 8 | * to install `astro-expressive-code` as an additional dependency into a user's project 9 | * (and thereby risiking version conflicts). 10 | * 11 | * Note: This file is intentionally not a TypeScript module to allow access to all exported 12 | * functionality even if TypeScript is not available, e.g. from the `ec.config.mjs` file 13 | * that does not get processed by Vite. 14 | */ 15 | 16 | export * from 'astro-expressive-code'; 17 | 18 | // @ts-ignore - Types are provided by the separate `expressive-code.d.ts` file 19 | export function defineEcConfig(config) { 20 | return config; 21 | } 22 | -------------------------------------------------------------------------------- /packages/starlight/global.d.ts: -------------------------------------------------------------------------------- 1 | export declare global { 2 | var StarlightThemeProvider: { 3 | updatePickers(theme?: string): void; 4 | }; 5 | } 6 | -------------------------------------------------------------------------------- /packages/starlight/i18n.d.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This file imports the original `i18next` types and extends them to configure the 3 | * Starlight namespace. 4 | * 5 | * Note that the top-level `import` makes this module non-ambient, so can’t be 6 | * combined with other `.d.ts` files such as `locals.d.ts`. 7 | */ 8 | 9 | import 'i18next'; 10 | 11 | declare module 'i18next' { 12 | interface CustomTypeOptions { 13 | defaultNS: typeof import('./utils/createTranslationSystem').I18nextNamespace; 14 | resources: { 15 | starlight: Record; 16 | }; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/starlight/integrations/code-rtl-support.ts: -------------------------------------------------------------------------------- 1 | import type { Root } from 'hast'; 2 | import { CONTINUE, SKIP, visit } from 'unist-util-visit'; 3 | 4 | /** 5 | * rehype plugin that adds `dir` attributes to `` and `
    `
     6 |  * elements that don’t already have them.
     7 |  *
     8 |  * `` will become ``
     9 |  * `
    ` will become `
    `
    10 |  *
    11 |  * `` _inside_ `
    ` is skipped, so respects the `ltr` on its parent.
    12 |  *
    13 |  * Reasoning:
    14 |  * - `
    ` is usually a code block and code should be LTR even in an RTL document
    15 |  * - `` is often LTR, but could also be RTL. `dir="auto"` ensures the bidirectional
    16 |  *   algorithm treats the contents of `` in isolation and gives its best guess.
    17 |  */
    18 | export function rehypeRtlCodeSupport() {
    19 | 	return () => (root: Root) => {
    20 | 		visit(root, 'element', (el) => {
    21 | 			if (el.tagName === 'pre' || el.tagName === 'code') {
    22 | 				el.properties ||= {};
    23 | 				if (!('dir' in el.properties)) {
    24 | 					el.properties.dir = { pre: 'ltr', code: 'auto' }[el.tagName];
    25 | 				}
    26 | 				return SKIP;
    27 | 			}
    28 | 			return CONTINUE;
    29 | 		});
    30 | 	};
    31 | }
    32 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/integrations/expressive-code/hast.d.ts:
    --------------------------------------------------------------------------------
    1 | /**
    2 |  * @file This file provides the types for Starlight's `@astrojs/starlight/expressive-code/hast` export.
    3 |  */
    4 | 
    5 | export * from 'astro-expressive-code/hast';
    6 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/integrations/expressive-code/hast.mjs:
    --------------------------------------------------------------------------------
     1 | /**
     2 |  * @file This file is exported by Starlight as `@astrojs/starlight/expressive-code/hast`.
     3 |  *
     4 |  * Note: This file is intentionally not a TypeScript module to allow access to all exported
     5 |  * functionality even if TypeScript is not available, e.g. from the `ec.config.mjs` file
     6 |  * that does not get processed by Vite.
     7 |  */
     8 | 
     9 | export * from 'astro-expressive-code/hast';
    10 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/integrations/shared/localeToLang.ts:
    --------------------------------------------------------------------------------
     1 | import type { StarlightConfig } from '../../types';
     2 | import { BuiltInDefaultLocale } from '../../utils/i18n';
     3 | 
     4 | /**
     5 |  * Get the BCP-47 language tag for the given locale.
     6 |  * @param locale Locale string or `undefined` for the root locale.
     7 |  */
     8 | export function localeToLang(
     9 | 	config: Pick,
    10 | 	locale: string | undefined
    11 | ): string {
    12 | 	const lang = locale ? config.locales?.[locale]?.lang : config.locales?.root?.lang;
    13 | 	const defaultLang = config.defaultLocale?.lang || config.defaultLocale?.locale;
    14 | 	return lang || defaultLang || BuiltInDefaultLocale.lang;
    15 | }
    16 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/integrations/shared/slugToLocale.ts:
    --------------------------------------------------------------------------------
     1 | import type { StarlightConfig } from '../../types';
     2 | 
     3 | /**
     4 |  * Get the “locale” of a slug. This is the base path at which a language is served.
     5 |  * For example, if French docs are in `src/content/docs/french/`, the locale is `french`.
     6 |  * Root locale slugs will return `undefined`.
     7 |  * @param slug A collection entry slug
     8 |  */
     9 | export function slugToLocale(
    10 | 	slug: string | undefined,
    11 | 	config: Pick
    12 | ): string | undefined {
    13 | 	const localesConfig = config.locales ?? {};
    14 | 	const baseSegment = slug?.split('/')[0];
    15 | 	if (baseSegment && localesConfig[baseSegment]) return baseSegment;
    16 | 	if (!localesConfig.root) return config.defaultLocale.locale;
    17 | 	return undefined;
    18 | }
    19 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/integrations/sitemap.ts:
    --------------------------------------------------------------------------------
     1 | import sitemap, { type SitemapOptions } from '@astrojs/sitemap';
     2 | import type { StarlightConfig } from '../types';
     3 | 
     4 | export function getSitemapConfig(opts: StarlightConfig): SitemapOptions {
     5 | 	const sitemapConfig: SitemapOptions = {};
     6 | 	if (opts.isMultilingual) {
     7 | 		sitemapConfig.i18n = {
     8 | 			defaultLocale: opts.defaultLocale.locale || 'root',
     9 | 			locales: Object.fromEntries(
    10 | 				Object.entries(opts.locales).map(([locale, config]) => [locale, config?.lang!])
    11 | 			),
    12 | 		};
    13 | 	}
    14 | 	return sitemapConfig;
    15 | }
    16 | 
    17 | /**
    18 |  * A wrapped version of the `@astrojs/sitemap` integration configured based
    19 |  * on Starlight i18n config.
    20 |  */
    21 | export function starlightSitemap(opts: StarlightConfig) {
    22 | 	return sitemap(getSitemapConfig(opts));
    23 | }
    24 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/internal.ts:
    --------------------------------------------------------------------------------
    1 | /**
    2 |  * @file This file contains utility functions imported by the `` component.
    3 |  */
    4 | 
    5 | export { useTranslations } from './utils/translations';
    6 | export { getStarlightEcConfigPreprocessor } from './integrations/expressive-code';
    7 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/playwright.config.ts:
    --------------------------------------------------------------------------------
     1 | import { defineConfig, devices } from '@playwright/test';
     2 | 
     3 | export default defineConfig({
     4 | 	forbidOnly: !!process.env['CI'],
     5 | 	projects: [
     6 | 		{
     7 | 			name: 'Chrome Stable',
     8 | 			use: {
     9 | 				...devices['Desktop Chrome'],
    10 | 				headless: true,
    11 | 			},
    12 | 		},
    13 | 	],
    14 | 	testMatch: '__e2e__/*.test.ts',
    15 | 	timeout: 40 * 1_000,
    16 | 	workers: 1,
    17 | });
    18 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/props.ts:
    --------------------------------------------------------------------------------
     1 | import type { StarlightRouteData } from './utils/routing/types';
     2 | export type { StarlightPageProps } from './utils/starlight-page';
     3 | 
     4 | /**
     5 |  * @deprecated The `Props` type is deprecated. If updating an override to use
     6 |  * `Astro.locals.starlightRoute` instead of `Astro.props`, import the new `StarlightRouteData`
     7 |  * type instead:
     8 |  * ```astro
     9 |  * ---
    10 |  * import type { StarlightRouteData } from '@astrojs/starlight/route-data';
    11 |  * ---
    12 |  * ```
    13 |  */
    14 | export type Props = StarlightRouteData;
    15 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/route-data.ts:
    --------------------------------------------------------------------------------
     1 | import type { APIContext } from 'astro';
     2 | export type { StarlightRouteData } from './utils/routing/types';
     3 | 
     4 | export type RouteMiddlewareHandler = (
     5 | 	context: APIContext,
     6 | 	next: () => Promise
     7 | ) => void | Promise;
     8 | 
     9 | export function defineRouteMiddleware(fn: RouteMiddlewareHandler) {
    10 | 	return fn;
    11 | }
    12 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/routes/common.astro:
    --------------------------------------------------------------------------------
     1 | ---
     2 | import { render } from 'astro:content';
     3 | import Page from '../components/Page.astro';
     4 | import { getRoute, useRouteData } from '../utils/routing/data';
     5 | import { attachRouteDataAndRunMiddleware } from '../utils/routing/middleware';
     6 | 
     7 | const route = await getRoute(Astro);
     8 | /**
     9 |  * The call to `render` from `astro:content` is purposely made in this file to work around a
    10 |  * development mode head propagation issue which is heavily tied to `astro:content` imports. Even
    11 |  * though we have a test for this, refactoring and moving this code to a different file should be
    12 |  * avoided for now until the linked issue which also contains more details is resolved.
    13 |  *
    14 |  * @see https://github.com/withastro/astro/issues/13724
    15 |  */
    16 | const renderResult = await render(route.entry);
    17 | 
    18 | await attachRouteDataAndRunMiddleware(Astro, await useRouteData(Astro, route, renderResult));
    19 | 
    20 | const { Content, entry } = Astro.locals.starlightRoute;
    21 | ---
    22 | 
    23 | {Content && }
    24 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/routes/ssr/404.astro:
    --------------------------------------------------------------------------------
    1 | ---
    2 | import FourOhFour from '../static/404.astro';
    3 | 
    4 | export const prerender = false;
    5 | ---
    6 | 
    7 | 
    8 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/routes/ssr/index.astro:
    --------------------------------------------------------------------------------
     1 | ---
     2 | import { getRouteBySlugParam } from '../../utils/routing';
     3 | import CommonPage from '../common.astro';
     4 | 
     5 | export const prerender = false;
     6 | 
     7 | const route = getRouteBySlugParam(Astro.params.slug);
     8 | 
     9 | if (route === undefined) {
    10 | 	return new Response(null, { status: 404 });
    11 | }
    12 | ---
    13 | 
    14 | 
    15 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/routes/static/404.astro:
    --------------------------------------------------------------------------------
    1 | ---
    2 | import CommonPage from '../common.astro';
    3 | 
    4 | export const prerender = true;
    5 | ---
    6 | 
    7 | 
    8 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/routes/static/index.astro:
    --------------------------------------------------------------------------------
     1 | ---
     2 | import { paths } from '../../utils/routing';
     3 | import CommonPage from '../common.astro';
     4 | 
     5 | export const prerender = true;
     6 | 
     7 | export async function getStaticPaths() {
     8 | 	return paths;
     9 | }
    10 | ---
    11 | 
    12 | 
    13 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/schemas/expressiveCode.ts:
    --------------------------------------------------------------------------------
     1 | import { z } from 'astro/zod';
     2 | import type { StarlightExpressiveCodeOptions } from '../integrations/expressive-code';
     3 | 
     4 | export const ExpressiveCodeSchema = () =>
     5 | 	z
     6 | 		.union([
     7 | 			z.custom((value) => typeof value === 'object' && value),
     8 | 			z.boolean(),
     9 | 		])
    10 | 		.describe(
    11 | 			'Define how code blocks are rendered by passing options to Expressive Code, or disable the integration by passing `false`.'
    12 | 		)
    13 | 		.optional();
    14 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/schemas/favicon.ts:
    --------------------------------------------------------------------------------
     1 | import { extname } from 'node:path';
     2 | import { z } from 'astro/zod';
     3 | 
     4 | const faviconTypeMap = {
     5 | 	'.ico': 'image/x-icon',
     6 | 	'.gif': 'image/gif',
     7 | 	'.jpeg': 'image/jpeg',
     8 | 	'.jpg': 'image/jpeg',
     9 | 	'.png': 'image/png',
    10 | 	'.svg': 'image/svg+xml',
    11 | };
    12 | 
    13 | export const FaviconSchema = () =>
    14 | 	z
    15 | 		.string()
    16 | 		.default('/favicon.svg')
    17 | 		.transform((favicon, ctx) => {
    18 | 			// favicon can be absolute or relative url
    19 | 			const { pathname } = new URL(favicon, 'https://example.com');
    20 | 			const ext = extname(pathname).toLowerCase();
    21 | 
    22 | 			if (!isFaviconExt(ext)) {
    23 | 				ctx.addIssue({
    24 | 					code: z.ZodIssueCode.custom,
    25 | 					message: 'favicon must be a .ico, .gif, .jpg, .png, or .svg file',
    26 | 				});
    27 | 
    28 | 				return z.NEVER;
    29 | 			}
    30 | 
    31 | 			return {
    32 | 				href: favicon,
    33 | 				type: faviconTypeMap[ext],
    34 | 			};
    35 | 		})
    36 | 		.describe(
    37 | 			'The default favicon for your site which should be a path to an image in the `public/` directory.'
    38 | 		);
    39 | 
    40 | function isFaviconExt(ext: string): ext is keyof typeof faviconTypeMap {
    41 | 	return ext in faviconTypeMap;
    42 | }
    43 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/schemas/head.ts:
    --------------------------------------------------------------------------------
     1 | import { z } from 'astro/zod';
     2 | 
     3 | export const HeadConfigSchema = () =>
     4 | 	z
     5 | 		.array(
     6 | 			z.object({
     7 | 				/** Name of the HTML tag to add to ``, e.g. `'meta'`, `'link'`, or `'script'`. */
     8 | 				tag: z.enum(['title', 'base', 'link', 'style', 'meta', 'script', 'noscript', 'template']),
     9 | 				/** Attributes to set on the tag, e.g. `{ rel: 'stylesheet', href: '/custom.css' }`. */
    10 | 				attrs: z.record(z.union([z.string(), z.boolean(), z.undefined()])).optional(),
    11 | 				/** Content to place inside the tag (optional). */
    12 | 				content: z.string().optional(),
    13 | 			})
    14 | 		)
    15 | 		.default([]);
    16 | 
    17 | export type HeadUserConfig = z.input>;
    18 | export type HeadConfig = z.output>;
    19 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/schemas/icon.ts:
    --------------------------------------------------------------------------------
    1 | import { z } from 'astro/zod';
    2 | import { Icons, type StarlightIcon } from '../components/Icons';
    3 | 
    4 | const iconNames = Object.keys(Icons) as [StarlightIcon, ...StarlightIcon[]];
    5 | 
    6 | /** String that matches the name of one of Starlight’s built-in icons. */
    7 | export const IconSchema = () => z.enum(iconNames);
    8 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/schemas/logo.ts:
    --------------------------------------------------------------------------------
     1 | import { z } from 'astro/zod';
     2 | 
     3 | export const LogoConfigSchema = () =>
     4 | 	z
     5 | 		.union([
     6 | 			z.object({
     7 | 				/** Source of the image file to use. */
     8 | 				src: z.string(),
     9 | 				/** Alternative text description of the logo. */
    10 | 				alt: z.string().default(''),
    11 | 				/** Set to `true` to hide the site title text and only show the logo. */
    12 | 				replacesTitle: z.boolean().default(false),
    13 | 			}),
    14 | 			z.object({
    15 | 				/** Source of the image file to use in dark mode. */
    16 | 				dark: z.string(),
    17 | 				/** Source of the image file to use in light mode. */
    18 | 				light: z.string(),
    19 | 				/** Alternative text description of the logo. */
    20 | 				alt: z.string().default(''),
    21 | 				/** Set to `true` to hide the site title text and only show the logo. */
    22 | 				replacesTitle: z.boolean().default(false),
    23 | 			}),
    24 | 		])
    25 | 		.optional();
    26 | 
    27 | export type LogoUserConfig = z.input>;
    28 | export type LogoConfig = z.output>;
    29 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/schemas/prevNextLink.ts:
    --------------------------------------------------------------------------------
     1 | import { z } from 'astro/zod';
     2 | 
     3 | export const PrevNextLinkConfigSchema = () =>
     4 | 	z
     5 | 		.union([
     6 | 			z.boolean(),
     7 | 			z.string(),
     8 | 			z
     9 | 				.object({
    10 | 					/** The navigation link URL. */
    11 | 					link: z.string().optional(),
    12 | 					/** The navigation link text. */
    13 | 					label: z.string().optional(),
    14 | 				})
    15 | 				.strict(),
    16 | 		])
    17 | 		.optional();
    18 | 
    19 | export type PrevNextLinkUserConfig = z.input>;
    20 | export type PrevNextLinkConfig = z.output>;
    21 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/schemas/site-title.ts:
    --------------------------------------------------------------------------------
     1 | import { z } from 'astro/zod';
     2 | 
     3 | export const TitleConfigSchema = () =>
     4 | 	z
     5 | 		.union([z.string(), z.record(z.string())])
     6 | 		.describe('Title for your website. Will be used in metadata and as browser tab title.');
     7 | 
     8 | // transform the title for runtime use
     9 | export const TitleTransformConfigSchema = (defaultLang: string) =>
    10 | 	TitleConfigSchema().transform((title, ctx) => {
    11 | 		if (typeof title === 'string') {
    12 | 			return { [defaultLang]: title };
    13 | 		}
    14 | 		if (!title[defaultLang] && title[defaultLang] !== '') {
    15 | 			ctx.addIssue({
    16 | 				code: z.ZodIssueCode.custom,
    17 | 				message: `Title must have a key for the default language "${defaultLang}"`,
    18 | 			});
    19 | 			return z.NEVER;
    20 | 		}
    21 | 		return title;
    22 | 	});
    23 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/schemas/social.ts:
    --------------------------------------------------------------------------------
     1 | import { z } from 'astro/zod';
     2 | import { IconSchema } from './icon';
     3 | 
     4 | const LinksSchema = z
     5 | 	.object({ icon: IconSchema(), label: z.string().min(1), href: z.string() })
     6 | 	.array()
     7 | 	.optional();
     8 | 
     9 | export const SocialLinksSchema = () =>
    10 | 	// Add a more specific error message to help people migrate from the old object syntax.
    11 | 	// TODO: remove once most people have updated to v0.33 or higher (e.g. when releasing Starlight v1)
    12 | 	z.preprocess((value, ctx) => {
    13 | 		if (value && typeof value === 'object' && !Array.isArray(value)) {
    14 | 			ctx.addIssue({
    15 | 				code: z.ZodIssueCode.custom,
    16 | 				message:
    17 | 					'Starlight v0.33.0 changed the `social` configuration syntax. Please specify an array of link items instead of an object.\n' +
    18 | 					'See the Starlight changelog for details: https://github.com/withastro/starlight/blob/main/packages/starlight/CHANGELOG.md#0330\n',
    19 | 			});
    20 | 		}
    21 | 		return value;
    22 | 	}, LinksSchema) as unknown as typeof LinksSchema;
    23 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/schemas/tableOfContents.ts:
    --------------------------------------------------------------------------------
     1 | import { z } from 'astro/zod';
     2 | 
     3 | const defaults = { minHeadingLevel: 2, maxHeadingLevel: 3 };
     4 | 
     5 | export const TableOfContentsSchema = () =>
     6 | 	z
     7 | 		.union([
     8 | 			z.object({
     9 | 				/** The level to start including headings at in the table of contents. Default: 2. */
    10 | 				minHeadingLevel: z.number().int().min(1).max(6).optional().default(2),
    11 | 				/** The level to stop including headings at in the table of contents. Default: 3. */
    12 | 				maxHeadingLevel: z.number().int().min(1).max(6).optional().default(3),
    13 | 			}),
    14 | 			z.boolean().transform((enabled) => (enabled ? defaults : false)),
    15 | 		])
    16 | 		.default(defaults)
    17 | 		.refine((toc) => (toc ? toc.minHeadingLevel <= toc.maxHeadingLevel : true), {
    18 | 			message: 'minHeadingLevel must be less than or equal to maxHeadingLevel',
    19 | 		});
    20 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/style/layers.css:
    --------------------------------------------------------------------------------
    1 | @layer starlight.base, starlight.reset, starlight.core, starlight.content, starlight.components, starlight.utils;
    2 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/style/reset.css:
    --------------------------------------------------------------------------------
     1 | @layer starlight.reset {
     2 | 	*,
     3 | 	*::before,
     4 | 	*::after {
     5 | 		box-sizing: border-box;
     6 | 	}
     7 | 
     8 | 	* {
     9 | 		margin: 0;
    10 | 	}
    11 | 
    12 | 	html {
    13 | 		color-scheme: dark;
    14 | 		accent-color: var(--sl-color-accent);
    15 | 	}
    16 | 
    17 | 	html[data-theme='light'] {
    18 | 		color-scheme: light;
    19 | 	}
    20 | 
    21 | 	body {
    22 | 		font-family: var(--__sl-font);
    23 | 		line-height: var(--sl-line-height);
    24 | 		-webkit-font-smoothing: antialiased;
    25 | 		color: var(--sl-color-text);
    26 | 		background-color: var(--sl-color-bg);
    27 | 	}
    28 | 
    29 | 	input,
    30 | 	button,
    31 | 	textarea,
    32 | 	select {
    33 | 		font: inherit;
    34 | 	}
    35 | 
    36 | 	p,
    37 | 	h1,
    38 | 	h2,
    39 | 	h3,
    40 | 	h4,
    41 | 	h5,
    42 | 	h6,
    43 | 	code {
    44 | 		overflow-wrap: anywhere;
    45 | 	}
    46 | 
    47 | 	code {
    48 | 		font-family: var(--__sl-font-mono);
    49 | 	}
    50 | }
    51 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/translations/README.md:
    --------------------------------------------------------------------------------
     1 | # Starlight UI translation files
     2 | 
     3 | This directory contains translation data for Starlight’s UI.
     4 | Each language has its own JSON file and follows the [translation structure described in Starlight’s docs](https://starlight.astro.build/guides/i18n/#translate-starlights-ui).
     5 | 
     6 | ## Add a new language
     7 | 
     8 | 1. Create a JSON file named using the BCP-47 tag for the language, e.g. `en.json` or `ja.json`.
     9 | 
    10 | 2. Fill the file with translations for each UI string. You can base your translations on [`en.json`](./en.json). Translate only the values, leaving the keys in English (e.g. `"search.label": "Buscar"`).
    11 | 
    12 | 3. Import your file in [`index.ts`](./index.ts) and add your language to the `Object.entries`.
    13 | 
    14 | 4. Open a pull request on GitHub to add your file to Starlight!
    15 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/translations/ja.json:
    --------------------------------------------------------------------------------
     1 | {
     2 |   "skipLink.label": "コンテンツにスキップ",
     3 |   "search.label": "検索",
     4 |   "search.ctrlKey": "Ctrl",
     5 |   "search.cancelLabel": "キャンセル",
     6 |   "search.devWarning": "検索はプロダクションビルドでのみ利用可能です。\nローカルでテストするには、サイトをビルドしてプレビューしてください。",
     7 |   "themeSelect.accessibleLabel": "テーマの選択",
     8 |   "themeSelect.dark": "ダーク",
     9 |   "themeSelect.light": "ライト",
    10 |   "themeSelect.auto": "自動",
    11 |   "languageSelect.accessibleLabel": "言語の選択",
    12 |   "menuButton.accessibleLabel": "メニュー",
    13 |   "sidebarNav.accessibleLabel": "メイン",
    14 |   "tableOfContents.onThisPage": "目次",
    15 |   "tableOfContents.overview": "概要",
    16 |   "i18n.untranslatedContent": "このコンテンツはまだ日本語訳がありません。",
    17 |   "page.editLink": "ページを編集",
    18 |   "page.lastUpdated": "最終更新日:",
    19 |   "page.previousLink": "前へ",
    20 |   "page.nextLink": "次へ",
    21 |   "page.draft": "このコンテンツは下書きです。プロダクションビルドには含まれません。",
    22 |   "404.text": "ページが見つかりません。 URL を確認するか、検索バーを使用してみてください。",
    23 |   "aside.note": "ノート",
    24 |   "aside.tip": "ヒント",
    25 |   "aside.caution": "注意",
    26 |   "aside.danger": "危険",
    27 |   "fileTree.directory": "ディレクトリ",
    28 |   "builtWithStarlight.label": "Starlightで作成",
    29 |   "heading.anchorLabel": "Section titled “{{title}}”"
    30 | }
    31 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/translations/ko.json:
    --------------------------------------------------------------------------------
     1 | {
     2 |   "skipLink.label": "콘텐츠로 이동",
     3 |   "search.label": "검색",
     4 |   "search.ctrlKey": "Ctrl",
     5 |   "search.cancelLabel": "취소",
     6 |   "search.devWarning": "검색 기능은 프로덕션 빌드에서만 작동합니다. \n로컬에서 테스트하려면 사이트를 빌드하고 미리 보기를 실행하세요.",
     7 |   "themeSelect.accessibleLabel": "테마 선택",
     8 |   "themeSelect.dark": "어두운 테마",
     9 |   "themeSelect.light": "밝은 테마",
    10 |   "themeSelect.auto": "자동",
    11 |   "languageSelect.accessibleLabel": "언어 선택",
    12 |   "menuButton.accessibleLabel": "메뉴",
    13 |   "sidebarNav.accessibleLabel": "메인",
    14 |   "tableOfContents.onThisPage": "목차",
    15 |   "tableOfContents.overview": "개요",
    16 |   "i18n.untranslatedContent": "이 콘텐츠는 아직 번역되지 않았습니다.",
    17 |   "page.editLink": "페이지 편집",
    18 |   "page.lastUpdated": "마지막 업데이트:",
    19 |   "page.previousLink": "이전 페이지",
    20 |   "page.nextLink": "다음 페이지",
    21 |   "page.draft": "이 콘텐츠는 아직 초안 상태이며, 최종 빌드에는 포함되지 않습니다.",
    22 |   "404.text": "페이지를 찾을 수 없습니다. URL을 다시 확인해보거나 검색을 사용해보세요.",
    23 |   "aside.note": "참고",
    24 |   "aside.tip": "팁",
    25 |   "aside.caution": "주의",
    26 |   "aside.danger": "위험",
    27 |   "fileTree.directory": "디렉터리",
    28 |   "builtWithStarlight.label": "이 웹사이트는 Starlight로 제작되었습니다.",
    29 |   "heading.anchorLabel": "섹션 제목: “{{title}}”"
    30 | }
    31 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/translations/zh-CN.json:
    --------------------------------------------------------------------------------
     1 | {
     2 |   "skipLink.label": "跳转到内容",
     3 |   "search.label": "搜索",
     4 |   "search.ctrlKey": "Ctrl",
     5 |   "search.cancelLabel": "取消",
     6 |   "search.devWarning": "搜索仅适用于生产版本。\n尝试构建并预览网站以在本地测试。",
     7 |   "themeSelect.accessibleLabel": "选择主题",
     8 |   "themeSelect.dark": "深色",
     9 |   "themeSelect.light": "浅色",
    10 |   "themeSelect.auto": "自动",
    11 |   "languageSelect.accessibleLabel": "选择语言",
    12 |   "menuButton.accessibleLabel": "菜单",
    13 |   "sidebarNav.accessibleLabel": "主要",
    14 |   "tableOfContents.onThisPage": "本页内容",
    15 |   "tableOfContents.overview": "概述",
    16 |   "i18n.untranslatedContent": "此内容尚不支持你的语言。",
    17 |   "page.editLink": "编辑此页",
    18 |   "page.lastUpdated": "最近更新:",
    19 |   "page.previousLink": "上一页",
    20 |   "page.nextLink": "下一页",
    21 |   "page.draft": "此内容为草稿,不会包含在生产版本中。",
    22 |   "404.text": "页面未找到。检查 URL 或尝试使用搜索栏。",
    23 |   "aside.note": "注意",
    24 |   "aside.tip": "提示",
    25 |   "aside.caution": "警告",
    26 |   "aside.danger": "危险",
    27 |   "fileTree.directory": "文件夹",
    28 |   "builtWithStarlight.label": "基于 Starlight 构建",
    29 |   "heading.anchorLabel": "Section titled “{{title}}”"
    30 | }
    31 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/translations/zh-TW.json:
    --------------------------------------------------------------------------------
     1 | {
     2 |   "skipLink.label": "跳到內容",
     3 |   "search.label": "搜尋",
     4 |   "search.ctrlKey": "Ctrl",
     5 |   "search.cancelLabel": "取消",
     6 |   "search.devWarning": "正式版本才能使用搜尋功能。\n如要在本地測試,請先建置並預覽網站。",
     7 |   "themeSelect.accessibleLabel": "選擇佈景主題",
     8 |   "themeSelect.dark": "深色",
     9 |   "themeSelect.light": "淺色",
    10 |   "themeSelect.auto": "自動",
    11 |   "languageSelect.accessibleLabel": "選擇語言",
    12 |   "menuButton.accessibleLabel": "選單",
    13 |   "sidebarNav.accessibleLabel": "主要",
    14 |   "tableOfContents.onThisPage": "本頁內容",
    15 |   "tableOfContents.overview": "概述",
    16 |   "i18n.untranslatedContent": "本頁內容尚未翻譯。",
    17 |   "page.editLink": "編輯頁面",
    18 |   "page.lastUpdated": "最後更新於:",
    19 |   "page.previousLink": "前一則",
    20 |   "page.nextLink": "下一則",
    21 |   "page.draft": "This content is a draft and will not be included in production builds.",
    22 |   "404.text": "找不到頁面。請檢查網址或改用搜尋功能。",
    23 |   "aside.note": "注意",
    24 |   "aside.tip": "提示",
    25 |   "aside.caution": "警告",
    26 |   "aside.danger": "危險",
    27 |   "fileTree.directory": "目錄",
    28 |   "builtWithStarlight.label": "Built with Starlight",
    29 |   "heading.anchorLabel": "Section titled “{{title}}”"
    30 | }
    31 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/types.ts:
    --------------------------------------------------------------------------------
    1 | export type { StarlightConfig } from './utils/user-config';
    2 | export type {
    3 | 	StarlightPlugin,
    4 | 	StarlightUserConfigWithPlugins as StarlightUserConfig,
    5 | 	HookParameters,
    6 | } from './utils/plugins';
    7 | export type { StarlightIcon } from './components/Icons';
    8 | 
    
    
    --------------------------------------------------------------------------------
    /packages/starlight/user-components/Aside.astro:
    --------------------------------------------------------------------------------
     1 | ---
     2 | import { AstroError } from 'astro/errors';
     3 | import Icon from './Icon.astro';
     4 | 
     5 | const asideVariants = ['note', 'tip', 'caution', 'danger'] as const;
     6 | const icons = { note: 'information', tip: 'rocket', caution: 'warning', danger: 'error' } as const;
     7 | 
     8 | interface Props {
     9 | 	type?: (typeof asideVariants)[number];
    10 | 	title?: string;
    11 | }
    12 | 
    13 | let { type = 'note', title } = Astro.props;
    14 | 
    15 | if (!asideVariants.includes(type)) {
    16 | 	throw new AstroError(
    17 | 		'Invalid `type` prop passed to the `