Simplify canonical url

This commit is contained in:
prototypa
2023-01-06 14:05:55 -05:00
parent ecdcf99958
commit 00b3ef7c17
6 changed files with 6 additions and 8 deletions

View File

@ -24,7 +24,6 @@ const currentPage = page.currentPage ?? 1;
const meta = {
title: `Blog${currentPage > 1 ? ` — Page ${currentPage}` : ''}`,
description: SITE.description,
canonical: getCanonical(getPermalink(BLOG?.blog?.pathname)),
ogType: 'blog',
noindex: currentPage > 1,
};

View File

@ -6,7 +6,7 @@ import BlogList from '~/components/blog/List.astro';
import Pagination from '~/components/common/Pagination.astro';
import { fetchPosts } from '~/utils/posts';
import { getCanonical, getPermalink, cleanSlug, CATEGORY_BASE } from '~/utils/permalinks';
import { cleanSlug, CATEGORY_BASE } from '~/utils/permalinks';
import Title from '~/components/blog/Title.astro';
export async function getStaticPaths({ paginate }) {
@ -36,7 +36,6 @@ const currentPage = page.currentPage ?? 1;
const meta = {
title: `Category'${category}' ${currentPage > 1 ? ` — Page ${currentPage}` : ''}`,
description: SITE.description,
canonical: getCanonical(getPermalink(category, 'category')),
noindex: true,
};
---

View File

@ -27,7 +27,7 @@ const url = getCanonical(getPermalink(post.slug, 'post'));
const meta = {
title: post.title,
description: post.description,
canonical: post.canonical || url,
canonical: post.canonical || undefined,
image: await findImage(post.image),
ogTitle: post.title,
ogType: 'article',

View File

@ -36,7 +36,6 @@ const currentPage = page.currentPage ?? 1;
const meta = {
title: `Posts by tag '${tag}'${currentPage > 1 ? ` — Page ${currentPage} ` : ''}`,
description: SITE.description,
canonical: getCanonical(getPermalink(tag, 'tag')),
noindex: true,
};
---