1
0
mirror of https://github.com/kremalicious/blog.git synced 2025-02-14 21:10:25 +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, site: config.siteUrl,
output: 'static', output: 'static',
cacheDir: '.astro', cacheDir: '.astro',
trailingSlash: 'always',
markdown: { markdown: {
remarkPlugins: [remarkLeadParagraph, remarkToc as any], remarkPlugins: [remarkLeadParagraph, remarkToc as any],
shikiConfig: { shikiConfig: {

View File

@ -18,23 +18,23 @@ export default {
menu: [ menu: [
{ {
title: 'Articles', title: 'Articles',
link: '/archive' link: '/archive/'
}, },
{ {
title: 'Photos', title: 'Photos',
link: '/photos' link: '/photos/'
}, },
{ {
title: 'Goodies', title: 'Goodies',
link: '/tags/goodies' link: '/tags/goodies/'
}, },
{ {
title: 'Tags', title: 'Tags',
link: '/tags' link: '/tags/'
}, },
{ {
title: '/Uses', title: '/Uses',
link: '/uses' link: '/uses/'
} }
] ]
} }

View File

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

View File

@ -10,7 +10,7 @@ type Props = {
const { i, slug, current } = Astro.props const { i, slug, current } = Astro.props
const classes = current ? `${styles.number} ${styles.current}` : styles.number 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}> <a class={classes} href={link}>

View File

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

View File

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

View File

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

View File

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

View File

@ -23,7 +23,7 @@ const descriptionFinal = description
const canonicalURL = const canonicalURL =
Astro.url.pathname === '/' Astro.url.pathname === '/'
? Astro.site?.origin ? Astro.site?.origin
: `${Astro.site?.origin}${Astro.url.pathname}` : `${Astro.site?.origin}${Astro.url.pathname.replace}`
const imageFinal = `${Astro.site?.origin}${ const imageFinal = `${Astro.site?.origin}${
image 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/')
--- ---