Set default titleTemplate

This commit is contained in:
prototypa
2023-01-06 13:18:21 -05:00
parent e478745e26
commit bb57b3b63f
7 changed files with 13 additions and 8 deletions

View File

@ -1,9 +1,8 @@
---
import Layout from '~/layouts/BaseLayout.astro';
import { SITE } from '~/config.mjs';
import Error404 from '~/components/widgets/Error404.astro';
const title = `Error 404 — ${SITE.name}`;
const title = `Error 404`;
---
<Layout meta={{ title }}>

View File

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

View File

@ -25,7 +25,7 @@ const { post } = Astro.props;
const url = getCanonical(getPermalink(post.slug, 'post'));
const meta = {
title: `${post.title} — ${SITE.name}`,
title: post.title,
description: post.description,
canonical: post.canonical || url,
image: await findImage(post.image),

View File

@ -34,7 +34,7 @@ const { page, category } = Astro.props;
const currentPage = page.currentPage ?? 1;
const meta = {
title: `Category '${category}' ${currentPage > 1 ? `— Page ${currentPage} ` : ''}— ${SITE.name}`,
title: `Category'${category}' ${currentPage > 1 ? ` — Page ${currentPage}` : ''}`,
description: SITE.description,
canonical: getCanonical(getPermalink(category, 'category')),
noindex: true,

View File

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

View File

@ -18,6 +18,7 @@ const meta = {
title: SITE.title,
description: SITE.description,
canonical: getCanonical(getHomePermalink()),
dontUseTitleTemplate: true,
};
---