diff --git a/src/components/blog-page/Post.astro b/src/components/blog-page/Post.astro index b9ff24f..f7ffee6 100644 --- a/src/components/blog-page/Post.astro +++ b/src/components/blog-page/Post.astro @@ -6,9 +6,10 @@ import Layout from "../../layouts/Layout.astro"; import "../../styles/blog.css"; const post = Astro.props.frontmatter ?? Astro.props; +const canonicalUrl = `https://novage.com.ua/blog/${post.slug}`; --- - +
diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 6511d79..2b73051 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -3,9 +3,10 @@ import "../styles/main.css"; interface Props { title: string; + canonical?: string; } -const { title } = Astro.props; +const { title, canonical } = Astro.props; --- @@ -47,6 +48,8 @@ const { title } = Astro.props; content="width=device-width, initial-scale=1, shrink-to-fit=no" /> + {canonical && } +