diff options
author | 2021-07-20 15:56:20 -0500 | |
---|---|---|
committer | 2021-07-20 15:56:20 -0500 | |
commit | 6915dc688bdd3bb5b9230c710516509ebec7ee78 (patch) | |
tree | 9b28aadbb3af7938c3c8fb35f3b1e55567d7e3fe /docs/src | |
parent | 225baf1fc69475500b1f65a7c9ed7dc601fec985 (diff) | |
download | astro-6915dc688bdd3bb5b9230c710516509ebec7ee78.tar.gz astro-6915dc688bdd3bb5b9230c710516509ebec7ee78.tar.zst astro-6915dc688bdd3bb5b9230c710516509ebec7ee78.zip |
docs: fix the templating setup for the `<title/>` in `MainLayout.astro` (#779)
Diffstat (limited to 'docs/src')
-rw-r--r-- | docs/src/config.ts | 4 | ||||
-rw-r--r-- | docs/src/layouts/Main.astro | 3 | ||||
-rw-r--r-- | docs/src/pages/index.astro | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/docs/src/config.ts b/docs/src/config.ts index 2a4197ae9..b24b5c499 100644 --- a/docs/src/config.ts +++ b/docs/src/config.ts @@ -67,3 +67,7 @@ export const sidebar = [ // ], // }, ]; + +export const site = { + title: 'Astro Documentation', +}; diff --git a/docs/src/layouts/Main.astro b/docs/src/layouts/Main.astro index f2a73e07e..25292896f 100644 --- a/docs/src/layouts/Main.astro +++ b/docs/src/layouts/Main.astro @@ -4,6 +4,7 @@ import SiteSidebar from '../components/SiteSidebar.astro'; import ThemeToggle from '../components/ThemeToggle.tsx'; import DocSidebar from '../components/DocSidebar.tsx'; import MenuToggle from '../components/MenuToggle.tsx'; +import { site } from "../config.ts"; const { content = {}, centered = false } = Astro.props; const headers = content?.astro?.headers; @@ -20,7 +21,7 @@ if (currentPage) { <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <title>{content.title}</title> + <title>{content.title ? `${content.title} 🚀 ${site.title}` : site.title}</title> <!-- This is intentionally inlined to avoid FOUC --> <script> diff --git a/docs/src/pages/index.astro b/docs/src/pages/index.astro index 2b0fd5d59..7b16ea1a0 100644 --- a/docs/src/pages/index.astro +++ b/docs/src/pages/index.astro @@ -2,7 +2,7 @@ import Layout from '../layouts/Main.astro'; --- -<Layout centered content={{ title: 'Astro Documentation' }}> +<Layout centered> <h1> <code style="white-space: nowrap;">npm init astro</code> </h1> |