diff --git a/docs/src/components/sidebar-preview.astro b/docs/src/components/sidebar-preview.astro index bd10705d16..f392972a00 100644 --- a/docs/src/components/sidebar-preview.astro +++ b/docs/src/components/sidebar-preview.astro @@ -17,7 +17,10 @@ function makeEntries(items: SidebarConfig): SidebarEntry[] { return { type: 'link', label: item.label, - href: item.link, + // Empty hrefs are used to represent internal links that do not exist in the Starlight + // docs. Using a non-existing anchor link like `#_` will not trigger a page reload or any + // scrolling. + href: item.link.length > 0 ? item.link : '#_', isCurrent: false, badge: item.badge, attrs: item.attrs ?? {}, diff --git a/docs/src/content/docs/guides/sidebar.mdx b/docs/src/content/docs/guides/sidebar.mdx index 726e9f9a27..bf9d360564 100644 --- a/docs/src/content/docs/guides/sidebar.mdx +++ b/docs/src/content/docs/guides/sidebar.mdx @@ -19,11 +19,11 @@ For example, given the following file structure: - src/ - content/ - docs/ - - guides/ - - components.md - - i18n.md - - reference/ - - configuration.md + - constellations/ + - andromeda.md + - orion.md + - stars/ + - betelgeuse.md @@ -32,17 +32,15 @@ The following sidebar will be automatically generated: @@ -62,10 +60,10 @@ Add a link to an internal or external page using an object with `label` and `lin ```js "label:" "link:" starlight({ sidebar: [ - // A link to the CSS & Styling guide. - { label: 'CSS & Styling', link: '/guides/css-and-tailwind/' }, - // An external link to the Astro website. - { label: 'Astro', link: 'https://astro.build/' }, + // A link to the Ganymede moon page. + { label: 'Ganymede', link: '/moons/ganymede/' }, + // An external link to the NASA website. + { label: 'NASA', link: 'https://www.nasa.gov/' }, ], }); ``` @@ -74,8 +72,8 @@ The configuration above generates the following sidebar: @@ -91,19 +89,19 @@ Add links or subgroups to the `items` array. ```js /^\s*(label:|items:)/ starlight({ sidebar: [ - // A group of links labelled "Guides". + // A group of links labelled "Constellations". { - label: 'Guides', + label: 'Constellations', items: [ - { label: 'Components', link: '/guides/components/' }, - { label: 'Internationalization (i18n)', link: '/guides/i18n/' }, - // A nested group of links. + { label: 'Carina', link: '/constellations/carina/' }, + { label: 'Centaurus', link: '/constellations/centaurus/' }, + // A nested group of links for seasonal constellations. { - label: 'Styling', + label: 'Seasonal', items: [ - { label: 'CSS', link: '/guides/css-and-tailwind/' }, - { label: 'Tailwind', link: '/guides/css-and-tailwind/' }, - { label: 'Shiki', link: '/guides/css-and-tailwind/' }, + { label: 'Andromeda', link: '/constellations/andromeda/' }, + { label: 'Orion', link: '/constellations/orion/' }, + { label: 'Ursa Minor', link: '/constellations/ursa-minor/' }, ], }, ], @@ -117,16 +115,16 @@ The configuration above generates the following sidebar: @@ -175,15 +173,13 @@ The following sidebar will be generated: - + ## 動画コンテンツ diff --git a/docs/src/content/docs/ko/reference/configuration.mdx b/docs/src/content/docs/ko/reference/configuration.mdx index 873634eaee..dccbd689f4 100644 --- a/docs/src/content/docs/ko/reference/configuration.mdx +++ b/docs/src/content/docs/ko/reference/configuration.mdx @@ -447,6 +447,9 @@ starlight({ }); ``` +`head`의 항목은 HTML 요소로 직접 변환되며 Astro의 [스크립트](https://docs.astro.build/ko/guides/client-side-scripts/#스크립트-처리)나 [스타일](https://docs.astro.build/ko/guides/styling/#astro에서-스타일링하기) 처리를 거치지 않습니다. +스크립트, 스타일 또는 이미지와 같은 로컬 자산을 가져와야 하는 경우 [Head 컴포넌트를 재정의하세요](/ko/guides/overriding-components/#내장-컴포넌트-재사용). + #### `HeadConfig` ```ts diff --git a/docs/src/content/docs/zh-cn/reference/configuration.mdx b/docs/src/content/docs/zh-cn/reference/configuration.mdx index f51d7b1057..8e3b3ce6bd 100644 --- a/docs/src/content/docs/zh-cn/reference/configuration.mdx +++ b/docs/src/content/docs/zh-cn/reference/configuration.mdx @@ -439,6 +439,8 @@ starlight({ }); ``` +在 `head` 中的条目会直接转换为 HTML 元素,并不会经过 Astro 的 [脚本](https://docs.astro.build/zh-cn/guides/client-side-scripts/#脚本处理) 或 [样式](https://docs.astro.build/zh-cn/guides/styling/#在-astro-进行设计) 处理。如果你需要导入本地资源,如脚本、样式或图片,请[重写 Head 组件](/zh-cn/guides/overriding-components/#复用内置组件)。 + #### `HeadConfig` ```ts