docs: fix the templating setup for the <title/>
in MainLayout.astro
(#779)
This commit is contained in:
parent
225baf1fc6
commit
6915dc688b
3 changed files with 7 additions and 2 deletions
|
@ -67,3 +67,7 @@ export const sidebar = [
|
||||||
// ],
|
// ],
|
||||||
// },
|
// },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const site = {
|
||||||
|
title: 'Astro Documentation',
|
||||||
|
};
|
||||||
|
|
|
@ -4,6 +4,7 @@ import SiteSidebar from '../components/SiteSidebar.astro';
|
||||||
import ThemeToggle from '../components/ThemeToggle.tsx';
|
import ThemeToggle from '../components/ThemeToggle.tsx';
|
||||||
import DocSidebar from '../components/DocSidebar.tsx';
|
import DocSidebar from '../components/DocSidebar.tsx';
|
||||||
import MenuToggle from '../components/MenuToggle.tsx';
|
import MenuToggle from '../components/MenuToggle.tsx';
|
||||||
|
import { site } from "../config.ts";
|
||||||
|
|
||||||
const { content = {}, centered = false } = Astro.props;
|
const { content = {}, centered = false } = Astro.props;
|
||||||
const headers = content?.astro?.headers;
|
const headers = content?.astro?.headers;
|
||||||
|
@ -20,7 +21,7 @@ if (currentPage) {
|
||||||
<head>
|
<head>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<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 -->
|
<!-- This is intentionally inlined to avoid FOUC -->
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
import Layout from '../layouts/Main.astro';
|
import Layout from '../layouts/Main.astro';
|
||||||
---
|
---
|
||||||
|
|
||||||
<Layout centered content={{ title: 'Astro Documentation' }}>
|
<Layout centered>
|
||||||
<h1>
|
<h1>
|
||||||
<code style="white-space: nowrap;">npm init astro</code>
|
<code style="white-space: nowrap;">npm init astro</code>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
Loading…
Reference in a new issue