Fix issue #55 Trailing Slash
This commit is contained in:
@ -3,6 +3,7 @@ export const SITE = {
|
||||
|
||||
origin: 'https://astrowind.vercel.app',
|
||||
basePathname: '/',
|
||||
trailingSlash: false,
|
||||
|
||||
title: 'AstroWind — Your website with Astro + Tailwind CSS',
|
||||
description: '🚀 AstroWind is a free and ready to start template to make your website using Astro and Tailwind CSS.',
|
||||
|
@ -25,7 +25,7 @@ const currentPage = page.currentPage ?? 1;
|
||||
const meta = {
|
||||
title: `Blog ${currentPage > 1 ? `— Page ${currentPage} ` : ''}— ${SITE.name}`,
|
||||
description: SITE.description,
|
||||
canonical: getCanonical(getPermalink(page.url.current)),
|
||||
canonical: getCanonical(getPermalink(BLOG?.blog?.pathname)),
|
||||
ogType: "blog",
|
||||
noindex: currentPage > 1
|
||||
};
|
||||
|
@ -11,7 +11,10 @@ const trim = (str, ch) => {
|
||||
};
|
||||
|
||||
const trimSlash = (s) => trim(trim(s, '/'));
|
||||
const createPath = (...params) => '/' + params.filter((el) => !!el).join('/');
|
||||
const createPath = (...params) => {
|
||||
const paths = params.filter((el) => !!el).join('/');
|
||||
return '/' + paths + (SITE.trailingSlash && paths ? '/' : '');
|
||||
};
|
||||
|
||||
const basePathname = trimSlash(SITE.basePathname);
|
||||
|
||||
|
Reference in New Issue
Block a user