|
1 | 1 | --- |
2 | 2 | import '../styles/global.css'; |
| 3 | +import { SEO } from 'astro-seo'; |
3 | 4 | import Header from '../components/Header.astro'; |
4 | 5 | import Footer from '../components/Footer.astro'; |
5 | 6 | import Prose from '../components/Prose.astro'; |
| 7 | +import { SITE_CONFIG } from '../config'; |
6 | 8 |
|
7 | | -const { pageTitle } = Astro.props; |
8 | | -const isAbout = pageTitle === 'About'; |
| 9 | +interface Props { |
| 10 | + metadata?: { |
| 11 | + title?: string; |
| 12 | + useTitleTemplate?: boolean; |
| 13 | + description?: string; |
| 14 | + }; |
| 15 | +} |
| 16 | +
|
| 17 | +const { metadata } = Astro.props; |
9 | 18 | --- |
10 | 19 |
|
11 | 20 | <!doctype html> |
@@ -58,15 +67,25 @@ const isAbout = pageTitle === 'About'; |
58 | 67 | ) |
59 | 68 | } |
60 | 69 |
|
61 | | - <!-- Basic SEO --> |
62 | | - <meta |
63 | | - name='description' |
64 | | - content='Jiho Kim is a human-computer interaction researcher studying how AI shapes thinking, writing, communication, and learning.' |
| 70 | + <!-- SEO --> |
| 71 | + <SEO |
| 72 | + title={metadata?.title || SITE_CONFIG.title} |
| 73 | + titleTemplate={metadata?.useTitleTemplate |
| 74 | + ? `%s - ${SITE_CONFIG.title}` |
| 75 | + : undefined} |
| 76 | + description={metadata?.description || SITE_CONFIG.description} |
| 77 | + openGraph={{ |
| 78 | + basic: { |
| 79 | + title: SITE_CONFIG.title, |
| 80 | + type: 'website', |
| 81 | + image: SITE_CONFIG.ogImage, |
| 82 | + url: SITE_CONFIG.siteUrl, |
| 83 | + }, |
| 84 | + }} |
65 | 85 | /> |
66 | | - {isAbout ? <title>Jiho Kim</title> : <title>{pageTitle} - Jiho Kim</title>} |
67 | 86 | </head> |
68 | 87 | <body class='min-h-screen flex flex-col pt-16 bg-white dark:bg-dark-bg'> |
69 | | - <Header pageTitle={pageTitle} /> |
| 88 | + <Header title={metadata?.title} /> |
70 | 89 | <main class='flex-1 my-12'> |
71 | 90 | <div class='max-w-3xl mx-auto px-4 md:px-0'> |
72 | 91 | <Prose> |
|
0 commit comments