diff options
| author | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-09-22 13:23:46 +0900 |
|---|---|---|
| committer | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-09-22 13:23:46 +0900 |
| commit | 1427bf4b507f849726a8028c81fe79832070ad3c (patch) | |
| tree | dfa21dd5b5aa964776cf0778d97aa98633d92c95 /src/components/starlight | |
| parent | a2ac8dc8299bfda5e6edf9434750691633b3084a (diff) | |
PageTitle.astro: ページに副題(subtitle)を表示できるようにする
Starlight のスキーマに subtitle(任意)を追加し、h1 の下に表示する。請願第19号の審査ページに副題を設定した(サイドバーには出ない)。
Diffstat (limited to 'src/components/starlight')
| -rw-r--r-- | src/components/starlight/PageTitle.astro | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/components/starlight/PageTitle.astro b/src/components/starlight/PageTitle.astro index 352e1c3..eba8bbd 100644 --- a/src/components/starlight/PageTitle.astro +++ b/src/components/starlight/PageTitle.astro @@ -1,5 +1,7 @@ --- import Breadcrumbs from './Breadcrumbs.astro'; + +const { title, subtitle } = Astro.locals.starlightRoute.entry.data; --- {Astro.url.pathname !== "/" && ( @@ -7,7 +9,8 @@ import Breadcrumbs from './Breadcrumbs.astro'; <div id="_top"> <Breadcrumbs /> </div> - <h1>{Astro.locals.starlightRoute.entry.data.title}</h1> + <h1>{title}</h1> + {subtitle && <p class="page-subtitle">{subtitle}</p>} </> )} @@ -20,5 +23,14 @@ import Breadcrumbs from './Breadcrumbs.astro'; font-weight: 600; color: var(--sl-color-white); } + + .page-subtitle { + margin-top: 0.75rem; + margin-bottom: 0; + font-size: var(--sl-text-lg); + line-height: var(--sl-line-height-headings); + font-weight: 400; + color: var(--sl-color-gray-2); + } } </style> |
