aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/PageHead.astro
diff options
context:
space:
mode:
authoraman333nolawz <amananudhiu@gmail.com>2026-03-02 21:49:13 +0530
committeraman333nolawz <amananudhiu@gmail.com>2026-03-02 21:49:13 +0530
commitd41eff9eccf66644c4c60f53cb516bf079937a28 (patch)
tree248a0863a3181369f943d678ec4273911d35efac /src/components/PageHead.astro
Using astro-erudite for static site generation
Diffstat (limited to 'src/components/PageHead.astro')
-rw-r--r--src/components/PageHead.astro36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/components/PageHead.astro b/src/components/PageHead.astro
new file mode 100644
index 0000000..7983fde
--- /dev/null
+++ b/src/components/PageHead.astro
@@ -0,0 +1,36 @@
+---
+import { SITE } from '@/consts'
+
+interface Props {
+ title?: string
+ description?: string
+ noindex?: boolean
+}
+
+const {
+ title = SITE.title,
+ description = SITE.description,
+ noindex = false,
+} = Astro.props
+const image = new URL('/static/1200x630.png', Astro.site)
+---
+
+<title>{`${title} | ${SITE.title}`}</title>
+<meta name="description" content={description} />
+<link rel="canonical" href={SITE.href} />
+{noindex && <meta name="robots" content="noindex, nofollow" />}
+
+<meta property="og:title" content={title} />
+<meta property="og:description" content={description} />
+<meta property="og:image" content={image} />
+<meta property="og:image:alt" content={title} />
+<meta property="og:type" content="website" />
+<meta property="og:locale" content={SITE.locale} />
+<meta property="og:site_name" content={SITE.title} />
+<meta property="og:url" content={Astro.url} />
+
+<meta name="twitter:title" content={title} />
+<meta name="twitter:description" content={description} />
+<meta name="twitter:image" content={image} />
+<meta name="twitter:image:alt" content={title} />
+<meta name="twitter:card" content="summary_large_image" />