diff --git a/src/components/PageHeader.astro b/src/components/PageHeader.astro index ea76d61..eb52290 100644 --- a/src/components/PageHeader.astro +++ b/src/components/PageHeader.astro @@ -7,7 +7,9 @@ interface Props { isHome?: boolean | undefined; } -const { title, isHome } = Astro.props; +const isHome = Astro.props.isHome === true; + +const { title } = Astro.props; const Nav = isHome ? Fragment : 'nav'; const Logo = isHome ? 'h1' : 'p'; diff --git a/src/pages/[...slug].astro b/src/pages/[...slug].astro index 501cb6b..96a7915 100644 --- a/src/pages/[...slug].astro +++ b/src/pages/[...slug].astro @@ -14,8 +14,6 @@ export async function getStaticPaths() { ); } -type Props = Awaited>[number]['props']; - const { entry } = Astro.props; const description = await getBlogDescription(entry); const { Content } = await entry.render(); diff --git a/src/pages/index.astro b/src/pages/index.astro index de20d90..8dad143 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -10,6 +10,14 @@ import { getBlogDescription } from '../lib/get-blog-description'; import { renderDateToHtml } from '../lib/render-date-to-html'; import { renderYearMonthRangeToHtml } from '../lib/render-year-month-range-to-html'; +function toPrimaryItem(entry: CollectionEntry<'blog'>): DetailsListItem { + return { + title: entry.data.title, + link: `/${entry.slug}`, + meta: siteTitle, + }; +} + const everylayoutEntry = await getEntry('blog', '20211011-publication-of-everylayout'); const primaryItems = [ @@ -62,14 +70,6 @@ const primaryItems = [ }, ] satisfies DetailsListItem[]; -function toPrimaryItem(entry: CollectionEntry<'blog'>): DetailsListItem { - return { - title: entry.data.title, - link: `/${entry.slug}`, - meta: SITE_TITLE, - }; -} - const projectItems = [ { title: 'sdenv',