1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-11-25 03:14:01 +01:00

add trailing slash

This commit is contained in:
Matthias Kretschmann 2023-10-03 16:14:03 +01:00
parent e1cd3d946c
commit a135103a9f
Signed by: m
GPG Key ID: 606EEEF3C479A91F
11 changed files with 16 additions and 15 deletions

View File

@ -13,6 +13,7 @@ export default defineConfig({
site: config.siteUrl,
output: 'static',
cacheDir: '.astro',
trailingSlash: 'always',
markdown: {
remarkPlugins: [remarkLeadParagraph, remarkToc as any],
shikiConfig: {

View File

@ -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/'
}
]
}

View File

@ -21,7 +21,7 @@ const { name, url, github } = config.author
<Github />
View source
</a>
<a href="/thanks" class={styles.btc}>
<a href="/thanks/" class={styles.btc}>
<Bitcoin />
Say Thanks
</a>

View File

@ -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}/`
---
<a class={classes} href={link}>

View File

@ -15,11 +15,11 @@ const isLast = currentPage === numPages
---
<div class={styles.pagination}>
{!isFirst && <PrevNext prevPagePath={`${slug}/${currentPage - 1}`} />}
{!isFirst && <PrevNext prevPagePath={`${slug}/${currentPage - 1}/`} />}
{
Array.from({ length: numPages }, (_, i) => (
<PageNumber i={i} slug={slug} current={currentPage === i + 1} />
))
}
{!isLast && <PrevNext nextPagePath={`${slug}/${currentPage + 1}`} />}
{!isLast && <PrevNext nextPagePath={`${slug}/${currentPage + 1}/`} />}
</div>

View File

@ -16,7 +16,7 @@ const { title, image } = data
{
image ? (
<a class="photo" href={`/${slug}`}>
<a class="photo" href={`/${slug}/`}>
<Picture
width={202}
height={202}

View File

@ -15,7 +15,7 @@ const { title, date, updated } = post.data
const { image } = post.data as CollectionEntry<'articles'>['data']
---
<a class={styles.post} href={`/${slug}`}>
<a class={styles.post} href={`/${slug}/`}>
{
image ? (
<Picture

View File

@ -17,7 +17,7 @@ function SearchResultsPure({
<ul className={styles.results}>
{results.map((post) => (
<li key={post.slug}>
<a className={styles.post} href={post.slug}>
<a className={styles.post} href={`/${post.slug}/`}>
{/* {post.data.image && (
<img src={post.data.image.src} alt={post.data.title} />
)} */}

View File

@ -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

View File

@ -1,3 +1,3 @@
---
return Astro.redirect('/archive/1')
return Astro.redirect('/archive/1/')
---

View File

@ -1,3 +1,3 @@
---
return Astro.redirect('/photos/1')
return Astro.redirect('/photos/1/')
---