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:
parent
e1cd3d946c
commit
a135103a9f
@ -13,6 +13,7 @@ export default defineConfig({
|
||||
site: config.siteUrl,
|
||||
output: 'static',
|
||||
cacheDir: '.astro',
|
||||
trailingSlash: 'always',
|
||||
markdown: {
|
||||
remarkPlugins: [remarkLeadParagraph, remarkToc as any],
|
||||
shikiConfig: {
|
||||
|
@ -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/'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -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>
|
||||
|
@ -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}>
|
||||
|
@ -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>
|
||||
|
@ -16,7 +16,7 @@ const { title, image } = data
|
||||
|
||||
{
|
||||
image ? (
|
||||
<a class="photo" href={`/${slug}`}>
|
||||
<a class="photo" href={`/${slug}/`}>
|
||||
<Picture
|
||||
width={202}
|
||||
height={202}
|
||||
|
@ -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
|
||||
|
@ -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} />
|
||||
)} */}
|
||||
|
@ -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
|
||||
|
@ -1,3 +1,3 @@
|
||||
---
|
||||
return Astro.redirect('/archive/1')
|
||||
return Astro.redirect('/archive/1/')
|
||||
---
|
||||
|
@ -1,3 +1,3 @@
|
||||
---
|
||||
return Astro.redirect('/photos/1')
|
||||
return Astro.redirect('/photos/1/')
|
||||
---
|
||||
|
Loading…
Reference in New Issue
Block a user