summaryrefslogtreecommitdiff
path: root/examples/blog-multiple-authors/src/components/MainHead.astro
diff options
context:
space:
mode:
authorGravatar Fred K. Schott <fkschott@gmail.com> 2021-06-28 15:29:16 -0700
committerGravatar GitHub <noreply@github.com> 2021-06-28 15:29:16 -0700
commit5591d4eb9fc70e781804f940fabd334b53ce7056 (patch)
tree9c4c4ebaf708e959a96b1fc9cede9c1fc9cc40b5 /examples/blog-multiple-authors/src/components/MainHead.astro
parent7063c04dec48fcabcda104c42d61642a554f6044 (diff)
downloadastro-5591d4eb9fc70e781804f940fabd334b53ce7056.tar.gz
astro-5591d4eb9fc70e781804f940fabd334b53ce7056.tar.zst
astro-5591d4eb9fc70e781804f940fabd334b53ce7056.zip
update the blog example (#565)
Diffstat (limited to 'examples/blog-multiple-authors/src/components/MainHead.astro')
-rw-r--r--examples/blog-multiple-authors/src/components/MainHead.astro42
1 files changed, 42 insertions, 0 deletions
diff --git a/examples/blog-multiple-authors/src/components/MainHead.astro b/examples/blog-multiple-authors/src/components/MainHead.astro
new file mode 100644
index 000000000..fbdaa2965
--- /dev/null
+++ b/examples/blog-multiple-authors/src/components/MainHead.astro
@@ -0,0 +1,42 @@
+---
+export interface Props {
+ title: string;
+ description: string;
+ image?: string;
+ type?: string;
+ next?: string;
+ prev?: string;
+ canonicalURL?: string;
+}
+
+const { title, description, image, type, next, prev, canonicalURL } = Astro.props as Props;
+---
+
+<!-- Common -->
+<meta charset="UTF-8">
+<title>{title}</title>
+<meta name="description" content={description}>
+<link rel="preconnect" href="https://fonts.gstatic.com">
+<link href="https://fonts.googleapis.com/css2?family=Spectral:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
+<link rel="stylesheet" href="/global.css">
+<!-- Sitemap -->
+<link rel="sitemap" href="/sitemap.xml">
+<!-- RSS -->
+<link rel="alternate" type="application/rss+xml" href="/feed/posts.xml">
+
+<!-- SEO -->
+<link rel="canonical" href={canonicalURL}>
+{next && <link rel="next" aria-label="Previous Page" href={new URL(next, canonicalURL).href}>}
+{prev && <link rel="prev" aria-label="Next Page" href={new URL(prev, canonicalURL).href}>}
+
+<!-- OpenGraph -->
+<meta property="og:title" content={title}>
+<meta property="og:description" content={description}>
+{image && (<meta property="og:image" content={new URL(image, canonicalURL)}>)}
+
+<!-- Twitter -->
+<meta name="twitter:card" content={image ? 'summary_large_image' : 'summary'}>
+<meta name="twitter:site" content="@astro">
+<meta name="twitter:title" content={title}>
+<meta name="twitter:description" content={description}>
+{image && (<meta name="twitter:image" content={image}>)}