Skip to content

Commit

Permalink
fix: Update canonical URL in Post component (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
DimaDemchenko authored Sep 27, 2024
1 parent 8de610b commit 75161fe
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/components/blog-page/Post.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ 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}`;
---

<Layout title={post.title} canonical={canonicalUrl}>
<Layout title={post.title} canonical={post.canonicalURL}>
<Header />
<div id="content">
<article>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
canonicalURL: https://novage.com.ua/blog/setting-up-p2p-video-on-a-web-page-in-5-minutes-for-free
author: Andriy Lysnevych
date: "2019-03-22"
title: "Setting up p2p video on a web page in 5 minutes for free"
Expand Down
1 change: 1 addition & 0 deletions src/content/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { z, defineCollection } from "astro:content";
const blogCollection = defineCollection({
type: "content", // v2.5.0 and later
schema: z.object({
canonicalURL: z.string().url(),
title: z.string(),
date: z.string(),
description: z.string(),
Expand Down

0 comments on commit 75161fe

Please sign in to comment.