diff --git a/src/components/Toc.astro b/src/components/Toc.astro index 546005e..d2b8249 100644 --- a/src/components/Toc.astro +++ b/src/components/Toc.astro @@ -18,6 +18,7 @@ const fileName = page.file.split("/").pop()?.replace(".mdx", "") || ""; const url = `/${sectionPath}/${fileName}`; const title = + (page as any).title || page.frontmatter?.title || fileName.replace(/^\d+-/, "").replace(/-/g, " "); diff --git a/src/pages/html/0-introduction.mdx b/src/pages/html/0-introduction.mdx index c362ba2..d900915 100644 --- a/src/pages/html/0-introduction.mdx +++ b/src/pages/html/0-introduction.mdx @@ -5,4 +5,6 @@ import "github-markdown-css"; import Toc from "../../components/Toc.astro"; -# HTML Introduction +export const title = "HTMLってなに?"; + +# {title} diff --git a/src/pages/index.mdx b/src/pages/index.mdx index 9f32aac..303d626 100644 --- a/src/pages/index.mdx +++ b/src/pages/index.mdx @@ -6,6 +6,7 @@ import Title from '../components/Title.astro'; export const components = { h1: Title }; +export const title = "Hello World"; export const authors = [ { name: 'Jane', email: 'hi@jane.com' }, { name: 'John', twitter: '@john2002' }, diff --git a/src/pages/tips/terminal.mdx b/src/pages/tips/terminal.mdx index 948065b..f45091c 100644 --- a/src/pages/tips/terminal.mdx +++ b/src/pages/tips/terminal.mdx @@ -2,4 +2,6 @@ layout: "@/layouts/MarkdownLayout.astro" --- -# 黒い画面 +export const title = "黒い画面"; + +# {title}