diff options
author | 2022-08-29 18:00:08 +0200 | |
---|---|---|
committer | 2022-08-29 12:00:08 -0400 | |
commit | feb88afb8c784e0db65be96073a1b0064e36128c (patch) | |
tree | 5addfda086b0a315ae92b684fe065fea8c7970c7 /examples/docs/src/config.ts | |
parent | 046bfd908de8bbfe9d24d1531260f1e6df03e912 (diff) | |
download | astro-feb88afb8c784e0db65be96073a1b0064e36128c.tar.gz astro-feb88afb8c784e0db65be96073a1b0064e36128c.tar.zst astro-feb88afb8c784e0db65be96073a1b0064e36128c.zip |
fix: improve docs example (#4355)
* fix: improve docs example
* final touches
* chore: prettier
* lockfile
* ci?
* downgrade types node
* fresh lockfile
* lockfile and npmrc
* remove debug log
* Merge branch 'main' into docs-template-ts
* merging lockfiles suck
* update lockfile
* satisfy linter
Diffstat (limited to 'examples/docs/src/config.ts')
-rw-r--r-- | examples/docs/src/config.ts | 55 |
1 files changed, 33 insertions, 22 deletions
diff --git a/examples/docs/src/config.ts b/examples/docs/src/config.ts index b81bf9b4f..b8258b1f7 100644 --- a/examples/docs/src/config.ts +++ b/examples/docs/src/config.ts @@ -14,33 +14,44 @@ export const OPEN_GRAPH = { twitter: 'astrodotbuild', }; +// This is the type of the frontmatter you put in the docs markdown files. +export type Frontmatter = { + title: string; + description: string; + layout: string; + image?: { src: string; alt: string }; + dir?: 'ltr' | 'rtl'; + ogLocale?: string; + lang?: string; +}; + export const KNOWN_LANGUAGES = { English: 'en', -}; +} as const; +export const KNOWN_LANGUAGE_CODES = Object.values(KNOWN_LANGUAGES); -// Uncomment this to add an "Edit this page" button to every page of documentation. -// export const GITHUB_EDIT_URL = `https://github.com/withastro/astro/blob/main/docs/`; +export const GITHUB_EDIT_URL = `https://github.com/withastro/astro/tree/main/examples/docs`; -// Uncomment this to add an "Join our Community" button to every page of documentation. -// export const COMMUNITY_INVITE_URL = `https://astro.build/chat`; +export const COMMUNITY_INVITE_URL = `https://astro.build/chat`; -// Uncomment this to enable site search. // See "Algolia" section of the README for more information. -// export const ALGOLIA = { -// indexName: 'XXXXXXXXXX', -// appId: 'XXXXXXXXXX', -// apiKey: 'XXXXXXXXXX', -// } - -export const SIDEBAR = { - en: [ - { text: '', header: true }, - { text: 'Section Header', header: true }, - { text: 'Introduction', link: 'en/introduction' }, - { text: 'Page 2', link: 'en/page-2' }, - { text: 'Page 3', link: 'en/page-3' }, +export const ALGOLIA = { + indexName: 'XXXXXXXXXX', + appId: 'XXXXXXXXXX', + apiKey: 'XXXXXXXXXX', +}; - { text: 'Another Section', header: true }, - { text: 'Page 4', link: 'en/page-4' }, - ], +export type Sidebar = Record< + typeof KNOWN_LANGUAGE_CODES[number], + Record<string, { text: string; link: string }[]> +>; +export const SIDEBAR: Sidebar = { + en: { + 'Section Header': [ + { text: 'Introduction', link: 'en/introduction' }, + { text: 'Page 2', link: 'en/page-2' }, + { text: 'Page 3', link: 'en/page-3' }, + ], + 'Another Section': [{ text: 'Page 4', link: 'en/page-4' }], + }, }; |