chore: add name to page titles
This commit is contained in:
parent
280db0d969
commit
25dcd4dd37
|
@ -5,6 +5,7 @@ import Banner from "../components/Banner.astro";
|
|||
import Navbar from "../components/Navbar.astro";
|
||||
|
||||
export interface Props {
|
||||
isFront: boolean;
|
||||
title: string;
|
||||
}
|
||||
|
||||
|
@ -39,6 +40,7 @@ const footerLinks = [
|
|||
];
|
||||
|
||||
const canonicalURL = new URL(Astro.url.pathname, Astro.site).toString().replace(/\/$/, "");
|
||||
const isFrontPage = Astro.props.isFront;
|
||||
---
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
@ -54,7 +56,7 @@ const canonicalURL = new URL(Astro.url.pathname, Astro.site).toString().replace(
|
|||
rel="stylesheet"
|
||||
/>
|
||||
<link rel="canonical" href={canonicalURL} />
|
||||
<title>{title}</title>
|
||||
<title>{isFrontPage ? title : `${title} | Oliver Davies`}</title>
|
||||
<script
|
||||
defer
|
||||
data-domain="oliverdavies.uk"
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
import BaseLayout from "./Layout.astro";
|
||||
import Markdown from "~/components/Markdown.astro";
|
||||
|
||||
const { title } = Astro.props.frontmatter || Astro.props;
|
||||
const { isFront, title } = Astro.props.frontmatter || Astro.props;
|
||||
---
|
||||
|
||||
<BaseLayout title={title}>
|
||||
<BaseLayout isFront={isFront || false} title={title}>
|
||||
<Markdown>
|
||||
<slot />
|
||||
</Markdown>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
---
|
||||
layout: ~/layouts/PageLayout.astro
|
||||
title: Oliver Davies - Software Developer and Drupal Expert
|
||||
isFront: true
|
||||
---
|
||||
|
||||
import { numberOfYears } from '~/utils';
|
||||
|
|
Loading…
Reference in a new issue