From a135103a9fb59b3800193e2e49b33d75c9100cf5 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Tue, 3 Oct 2023 16:14:03 +0100 Subject: [PATCH] add trailing slash --- .config/astro.config.ts | 1 + .config/blog.config.ts | 10 +++++----- src/components/Footer/index.astro | 2 +- src/components/Pagination/PageNumber.astro | 2 +- src/components/Pagination/index.astro | 4 ++-- src/components/PhotoTeaser.astro | 2 +- src/components/PostTeaser/index.astro | 2 +- src/components/Search/Results/index.tsx | 2 +- src/components/layouts/Base/Head.astro | 2 +- src/pages/archive/index.astro | 2 +- src/pages/photos/index.astro | 2 +- 11 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.config/astro.config.ts b/.config/astro.config.ts index 985be56c..870c1479 100644 --- a/.config/astro.config.ts +++ b/.config/astro.config.ts @@ -13,6 +13,7 @@ export default defineConfig({ site: config.siteUrl, output: 'static', cacheDir: '.astro', + trailingSlash: 'always', markdown: { remarkPlugins: [remarkLeadParagraph, remarkToc as any], shikiConfig: { diff --git a/.config/blog.config.ts b/.config/blog.config.ts index 9cd578d1..96e577a7 100644 --- a/.config/blog.config.ts +++ b/.config/blog.config.ts @@ -18,23 +18,23 @@ export default { menu: [ { title: 'Articles', - link: '/archive' + link: '/archive/' }, { title: 'Photos', - link: '/photos' + link: '/photos/' }, { title: 'Goodies', - link: '/tags/goodies' + link: '/tags/goodies/' }, { title: 'Tags', - link: '/tags' + link: '/tags/' }, { title: '/Uses', - link: '/uses' + link: '/uses/' } ] } diff --git a/src/components/Footer/index.astro b/src/components/Footer/index.astro index e033c6ff..d559bb3a 100644 --- a/src/components/Footer/index.astro +++ b/src/components/Footer/index.astro @@ -21,7 +21,7 @@ const { name, url, github } = config.author View source - + Say Thanks diff --git a/src/components/Pagination/PageNumber.astro b/src/components/Pagination/PageNumber.astro index e35bba98..1e46c0d1 100644 --- a/src/components/Pagination/PageNumber.astro +++ b/src/components/Pagination/PageNumber.astro @@ -10,7 +10,7 @@ type Props = { const { i, slug, current } = Astro.props const classes = current ? `${styles.number} ${styles.current}` : styles.number -const link = i === 0 ? slug : `${slug}/${i + 1}` +const link = i === 0 ? slug : `${slug}/${i + 1}/` --- diff --git a/src/components/Pagination/index.astro b/src/components/Pagination/index.astro index db4f142c..c601bff6 100644 --- a/src/components/Pagination/index.astro +++ b/src/components/Pagination/index.astro @@ -15,11 +15,11 @@ const isLast = currentPage === numPages ---
- {!isFirst && } + {!isFirst && } { Array.from({ length: numPages }, (_, i) => ( )) } - {!isLast && } + {!isLast && }
diff --git a/src/components/PhotoTeaser.astro b/src/components/PhotoTeaser.astro index f091eb5a..381cf519 100644 --- a/src/components/PhotoTeaser.astro +++ b/src/components/PhotoTeaser.astro @@ -16,7 +16,7 @@ const { title, image } = data { image ? ( -
+ ['data'] --- - + { image ? ( {results.map((post) => (
  • - + {/* {post.data.image && ( {post.data.title} )} */} diff --git a/src/components/layouts/Base/Head.astro b/src/components/layouts/Base/Head.astro index 1c0eb165..83fe323c 100644 --- a/src/components/layouts/Base/Head.astro +++ b/src/components/layouts/Base/Head.astro @@ -23,7 +23,7 @@ const descriptionFinal = description const canonicalURL = Astro.url.pathname === '/' ? Astro.site?.origin - : `${Astro.site?.origin}${Astro.url.pathname}` + : `${Astro.site?.origin}${Astro.url.pathname.replace}` const imageFinal = `${Astro.site?.origin}${ image diff --git a/src/pages/archive/index.astro b/src/pages/archive/index.astro index 7bdbf08b..a0468d7a 100644 --- a/src/pages/archive/index.astro +++ b/src/pages/archive/index.astro @@ -1,3 +1,3 @@ --- -return Astro.redirect('/archive/1') +return Astro.redirect('/archive/1/') --- diff --git a/src/pages/photos/index.astro b/src/pages/photos/index.astro index bcb84f56..ebfe22d8 100644 --- a/src/pages/photos/index.astro +++ b/src/pages/photos/index.astro @@ -1,3 +1,3 @@ --- -return Astro.redirect('/photos/1') +return Astro.redirect('/photos/1/') ---