Getting Started
A modern and beautiful theme for Starlight.
Prerequisites
Section titled “Prerequisites”You will need to have a Starlight website set up.
If you don’t have one yet, you can follow the “Getting Started” guide in the Starlight docs to create one.
Installation
Section titled “Installation”-
The Starlight Nova theme is a Starlight plugin that you can install using your favorite package manager:
-
Configure the plugin in your Starlight configuration in the
astro.config.mjs
file.// astro.config.mjs import
from '@astrojs/starlight' import {starlight function starlight(userOpts: StarlightUserConfigWithPlugins): AstroIntegration
} from 'astro/config' importdefineConfig function defineConfig<const TLocales extends Locales = never, const TDriver extends SessionDriverName = never, const TFontFamilies extends FontFamily[] = never>(config: AstroUserConfig<TLocales, TDriver, TFontFamilies>): AstroUserConfig<TLocales, TDriver, TFontFamilies>
See the full Astro Configuration API Documentation https://astro.build/config from 'starlight-theme-nova' export defaultstarlightThemeNova function starlightThemeNova(options?: ThemeNovaOptions): StarlightPlugin
({defineConfig defineConfig<never, never, never>(config: AstroUserConfig<never, never, never>): AstroUserConfig<never, never, never>
See the full Astro Configuration API Documentation https://astro.build/config : [integrations AstroUserConfig<TLocales extends Locales = never, TSession extends SessionDriverName = never, TFontFamilies extends FontFamily[] = never>.integrations?: (false | AstroIntegration | (false | AstroIntegration | null | undefined)[] | null | undefined)[] | undefined
({starlight function starlight(userOpts: StarlightUserConfigWithPlugins): AstroIntegration
: [plugins plugins?: { name: string; hooks: { 'i18n:setup'?: ((args_0: { injectTranslations: (args_0: Record<string, Record<string, string>>) => void; }) => void | Promise<void>) | undefined; 'config:setup'?: ((args_0: { logger: AstroIntegrationLogger; config: { title: string | Record<string, string>; description?: string | undefined; logo?: { src: string; alt?: string | undefined; replacesTitle?: boolean | undefined; } | { dark: string; light: string; alt?: string | undefined; replacesTitle?: boolean | undefined; } | undefined; ... 20 more ...; markdown?: { ...; } | undefined; } & { ...; }; ... 7 more ...; useTranslations: (lang: string | undefined) => I18nT; }) => void | Promise<...>) | undefined; setup?: ((args_0: { logger: AstroIntegrationLogger; config: { title: string | Record<string, string>; description?: string | undefined; logo?: { src: string; alt?: string | undefined; replacesTitle?: boolean | undefined; } | { dark: string; light: string; alt?: string | undefined; replacesTitle?: boolean | undefined; } | undefined; ... 20 more ...; markdown?: { ...; } | undefined; } & { ...; }; ... 7 more ...; useTranslations: (lang: string | undefined) => I18nT; }) => void | Promise<...>) | undefined; }; }[] | undefined
A list of plugins to extend Starlight with. (/* options */), ],starlightThemeNova function starlightThemeNova(options?: ThemeNovaOptions): StarlightPlugin
: 'My Docs', }), ], })title title: string | Record<string, string>
Title for your website. Will be used in metadata and as browser tab title.Check the Options section below for available options.
-
Start the development server to preview the theme in action.
That’s it! You should now see the Starlight Nova theme applied to your Starlight website.
Options
Section titled “Options”You can add optional navigation items to the top navigation bar by passing an array of objects to the nav
option.
starlightThemeNova function starlightThemeNova(options?: ThemeNovaOptions): StarlightPlugin
({
nav ThemeNovaOptions.nav?: NavItem[] | undefined
: [
{ label NavItem.label: string | Record<string, string>
The visible label for this item in the navigation. It could be a string or
a record of strings with the language code as the key. : 'Quick start', href NavItem.href: string | Record<string, string>
The link to this item’s content. It could be a string or a record of
strings with the language code as the key. : '/guide/getting-started' },
{ label NavItem.label: string | Record<string, string>
The visible label for this item in the navigation. It could be a string or
a record of strings with the language code as the key. : 'External link', href NavItem.href: string | Record<string, string>
The link to this item’s content. It could be a string or a record of
strings with the language code as the key. : 'https://example.com' },
],
})
If you want to support multiple languages, you can pass an object with values for each different locale to label
and href
. When using the object form, the keys must be BCP-47 tags (e.g. en
, ar
, or zh-CN
) or the root
key to set the default value:
starlightThemeNova function starlightThemeNova(options?: ThemeNovaOptions): StarlightPlugin
({
nav ThemeNovaOptions.nav?: NavItem[] | undefined
: [
{
label NavItem.label: string | Record<string, string>
The visible label for this item in the navigation. It could be a string or
a record of strings with the language code as the key. : {
en en: string
: 'Quick start',
'zh-CN': '快速开始',
},
href NavItem.href: string | Record<string, string>
The link to this item’s content. It could be a string or a record of
strings with the language code as the key. : {
en en: string
: '/guide/getting-started',
'zh-CN': '/zh-CN/guide/getting-started',
},
},
],
})