diff options
author | 2022-07-21 10:45:59 -0700 | |
---|---|---|
committer | 2022-07-21 13:45:59 -0400 | |
commit | ddefb172f66bcd646dd0b75a7ea8360157dd2ba0 (patch) | |
tree | a43eb2a6a7cadf867e3f333e09ebac51974b1438 /examples/blog-multiple-authors/src/pages/index.astro | |
parent | d503c5bf3db39afeecb28522861ac5d78c919408 (diff) | |
download | astro-ddefb172f66bcd646dd0b75a7ea8360157dd2ba0.tar.gz astro-ddefb172f66bcd646dd0b75a7ea8360157dd2ba0.tar.zst astro-ddefb172f66bcd646dd0b75a7ea8360157dd2ba0.zip |
Replace/Rename Astro.canonicalURL with new Astro.url helper (#3959)
* add Astro.url
* Add examples of how to create the canonicalURL
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Diffstat (limited to 'examples/blog-multiple-authors/src/pages/index.astro')
-rw-r--r-- | examples/blog-multiple-authors/src/pages/index.astro | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/blog-multiple-authors/src/pages/index.astro b/examples/blog-multiple-authors/src/pages/index.astro index 91168ed43..8e47b8f15 100644 --- a/examples/blog-multiple-authors/src/pages/index.astro +++ b/examples/blog-multiple-authors/src/pages/index.astro @@ -12,7 +12,7 @@ import authorData from "../data/authors.json"; // 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.canonicalURL; +const canonicalURL = new URL(Astro.url.pathname, Astro.site); // Data Fetching: List all Markdown posts in the repo. let allPosts = await Astro.glob("./post/*.md"); |