Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update canonical URL in Post component #19

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading