diff options
author | 2021-10-15 03:40:33 +0900 | |
---|---|---|
committer | 2021-10-14 14:40:33 -0400 | |
commit | 32dbf68247720c7a9c81a55d29cf763d1e14a801 (patch) | |
tree | 95d7b09100ccb7f3e55d5eef9b8699fd3220ced2 /examples/blog-multiple-authors/src/pages | |
parent | 7e4f91db609f43b54070518ab099f643f331f445 (diff) | |
download | astro-32dbf68247720c7a9c81a55d29cf763d1e14a801.tar.gz astro-32dbf68247720c7a9c81a55d29cf763d1e14a801.tar.zst astro-32dbf68247720c7a9c81a55d29cf763d1e14a801.zip |
Fix type error in blog-multiple-authors example (#1553)
* chore: add description to avoid type error
* fix: fix canonical url type in main head component
Diffstat (limited to 'examples/blog-multiple-authors/src/pages')
-rw-r--r-- | examples/blog-multiple-authors/src/pages/about.astro | 5 | ||||
-rw-r--r-- | examples/blog-multiple-authors/src/pages/index.astro | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/examples/blog-multiple-authors/src/pages/about.astro b/examples/blog-multiple-authors/src/pages/about.astro index 44a9424cf..69124a3fa 100644 --- a/examples/blog-multiple-authors/src/pages/about.astro +++ b/examples/blog-multiple-authors/src/pages/about.astro @@ -3,12 +3,15 @@ import MainHead from '../components/MainHead.astro'; import Nav from '../components/Nav.astro'; let title = "About"; +let description = "About page of an example blog on Astro"; +let canonicalURL = Astro.request.canonicalURL; --- <html lang="en"> <head> <MainHead title={title} - canonicalURL={Astro.request.canonicalURL} + description={description} + canonicalURL={canonicalURL} /> <style lang="scss"> diff --git a/examples/blog-multiple-authors/src/pages/index.astro b/examples/blog-multiple-authors/src/pages/index.astro index da7539394..5c18a87f0 100644 --- a/examples/blog-multiple-authors/src/pages/index.astro +++ b/examples/blog-multiple-authors/src/pages/index.astro @@ -18,6 +18,7 @@ interface MarkdownFrontmatter { // All variables are available to use in the HTML template below. let title = 'Don’s Blog'; let description = 'An example blog on Astro'; +let canonicalURL = Astro.request.canonicalURL; // Data Fetching: List all Markdown posts in the repo. let allPosts = Astro.fetchContent<MarkdownFrontmatter>('./post/*.md'); @@ -34,7 +35,7 @@ let firstPage = allPosts.slice(0, 2); title={title} description={description} image={allPosts[0].image} - canonicalURL={Astro.request.canonicalURL.href} + canonicalURL={canonicalURL} /> </head> |