summaryrefslogtreecommitdiff
path: root/examples/blog
diff options
context:
space:
mode:
authorGravatar Drew Powers <1369770+drwpow@users.noreply.github.com> 2021-05-11 17:31:52 -0600
committerGravatar GitHub <noreply@github.com> 2021-05-11 17:31:52 -0600
commit7184149514260c9c5f8525648af1c0f2e51c998e (patch)
tree251fad305a2e22ea91adecd1e1f751b67c2bab09 /examples/blog
parentd2eb413a6e4d423880bb3af93b63e3f37a6f1049 (diff)
downloadastro-7184149514260c9c5f8525648af1c0f2e51c998e.tar.gz
astro-7184149514260c9c5f8525648af1c0f2e51c998e.tar.zst
astro-7184149514260c9c5f8525648af1c0f2e51c998e.zip
Add Astro.request.canonicalURL and Astro.site to global (#199)
Diffstat (limited to 'examples/blog')
-rw-r--r--examples/blog/public/global.scss (renamed from examples/blog/public/global.css)0
-rw-r--r--examples/blog/src/components/MainHead.astro7
-rw-r--r--examples/blog/src/pages/index.astro6
3 files changed, 12 insertions, 1 deletions
diff --git a/examples/blog/public/global.css b/examples/blog/public/global.scss
index a6007631a..a6007631a 100644
--- a/examples/blog/public/global.css
+++ b/examples/blog/public/global.scss
diff --git a/examples/blog/src/components/MainHead.astro b/examples/blog/src/components/MainHead.astro
index bff812b0c..dfeb9dfb4 100644
--- a/examples/blog/src/components/MainHead.astro
+++ b/examples/blog/src/components/MainHead.astro
@@ -4,6 +4,9 @@ export let title: string;
export let description: string;
export let image: string | undefined;
export let type: string | undefined;
+export let next: string | undefined;
+export let prev: string | undefined;
+export let canonicalURL: string | undefined;
// internal data
const OG_TYPES = {
@@ -17,6 +20,10 @@ const OG_TYPES = {
<title>{title}</title>
<meta name="description" content={description} />
<link rel="stylesheet" href="/global.css" />
+<link rel="sitemap" href="/sitemap.xml" />
+<link rel="canonical" href={canonicalURL} />
+{next && <link rel="next" href={next} />}
+{prev && <link rel="prev" href={prev} />}
<!-- OpenGraph -->
<meta property="og:title" content={title} />
diff --git a/examples/blog/src/pages/index.astro b/examples/blog/src/pages/index.astro
index 2af3a1a03..19ea4ebf9 100644
--- a/examples/blog/src/pages/index.astro
+++ b/examples/blog/src/pages/index.astro
@@ -21,7 +21,11 @@ let firstThree = allPosts.slice(0, 3);
<html>
<head>
<title>{title}</title>
- <MainHead title={title} description={description} />
+ <MainHead
+ title={title}
+ description={description}
+ canonicalURL={Astro.request.canonicalURL.href}
+ />
</head>
<body>