Skip to content

Commit 79a47a8

Browse files
committed
Fix 404 errors due to trailing slash issues on many pages
1 parent f14139b commit 79a47a8

14 files changed

Lines changed: 138 additions & 118 deletions

File tree

‎src/components/Carousel/index.astro‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ if (limit) {
9898
<div class="embla__slide flex-[0_0_100%] md:flex-[0_0_50%] lg:flex-[0_0_33.333%] min-w-0">
9999
<article class="group h-full">
100100
<a
101-
href={`/${type}/${item.id}/`}
101+
href={`/${type}/${item.id}`}
102102
class="block h-full bg-[color:var(--color-bg)] rounded-xl shadow-lg hover:shadow-xl transition-all duration-300 overflow-hidden border border-[color:var(--color-border)] hover:border-[color:var(--color-primary)] transform hover:-translate-y-2"
103103
>
104104
{'icon' in item.data && item.data.icon && (

‎src/pages/articles/[...slug].astro‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export async function getStaticPaths() {
1616
1717
const { article } = Astro.props
1818
const renderedContent = article.rendered?.html || article.body || 'Content not available'
19-
const path = `/articles/${article.id}/`
19+
const path = `/articles/${article.id}`
2020
const pageTitle = article.data.title
2121
const cover = article.data.image
2222
const authorId =

‎src/pages/articles/index.astro‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const sortedArticles = allArticles.sort(
2424
{
2525
sortedArticles.map(article => (
2626
<article class="bg-[var(--color-theme-bg)] rounded-2xl shadow-lg hover:shadow-xl transition-all duration-300 hover:-translate-y-1 overflow-hidden group">
27-
<a href={`/articles/${article.id}/`} class="block">
27+
<a href={`/articles/${article.id}`} class="block">
2828
{article.data.image && (
2929
<div class="aspect-video overflow-hidden">
3030
<img

‎src/pages/case-studies/[slug].astro‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export async function getStaticPaths() {
1313
}
1414
1515
const { caseStudy } = Astro.props
16-
const path = `/case-studies/${caseStudy.id}/`
16+
const path = `/case-studies/${caseStudy.id}`
1717
const pageTitle = caseStudy.data.title
1818
const cover = caseStudy.data.image
1919
? typeof caseStudy.data.image === 'string'

‎src/pages/case-studies/index.astro‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const sortedCaseStudies = allCaseStudies.sort(
2020
{
2121
sortedCaseStudies.map(caseStudy => (
2222
<article class="bg-[var(--color-theme-bg)] rounded-2xl shadow-lg hover:shadow-xl transition-all duration-300 hover:-translate-y-1 overflow-hidden group">
23-
<a href={`/case-studies/${caseStudy.id}/`} class="block h-full">
23+
<a href={`/case-studies/${caseStudy.id}`} class="block h-full">
2424
{caseStudy.data.image && (
2525
<div class="aspect-video overflow-hidden">
2626
<img

‎src/pages/downloads/[...slug].astro‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export async function getStaticPaths() {
2121
2222
const { download } = Astro.props
2323
const renderedContent = download.rendered?.html || download.body || 'Content not available'
24-
const path = `/downloads/${download.id}/`
24+
const path = `/downloads/${download.id}`
2525
const pageTitle = download.data.title
2626
const cover = download.data.image
2727
const authorId =

‎src/pages/services/[slug].astro‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export async function getStaticPaths() {
1313
}
1414
1515
const { service } = Astro.props
16-
const path = `/services/${service.id}/`
16+
const path = `/services/${service.id}`
1717
const pageTitle = service.data.title
1818
const icon = service.data.icon ? { src: service.data.icon, alt: service.data.title } : undefined
1919
---

‎src/pages/services/index.astro‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const services = allServices.sort(
3030
{services.map(service => (
3131
<li class="service-item">
3232
<a
33-
href={`/services/${service.id}/`}
33+
href={`/services/${service.id}`}
3434
class="block group hover:bg-[var(--color-theme-bg-offset)] rounded-lg p-6 transition-colors duration-200 border border-transparent hover:border-[var(--color-theme-border)]"
3535
>
3636
<div class="flex items-start space-x-6">

‎src/pages/tags/[tag].astro‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const path = `/tags/${tag}/`
8080
{paginatedContent.map(item => (
8181
<article class="bg-[var(--color-theme-bg)] rounded-2xl shadow-lg hover:shadow-xl transition-all duration-300 hover:-translate-y-1 overflow-hidden group">
8282
<a
83-
href={`/${item.type === 'case-study' ? 'case-studies' : item.type === 'service' ? 'services' : 'articles'}/${item.id}/`}
83+
href={`/${item.type === 'case-study' ? 'case-studies' : item.type === 'service' ? 'services' : 'articles'}/${item.id}`}
8484
class="block h-full"
8585
>
8686
{'image' in item.data && item.data.image && (

‎src/pages/tags/index.astro‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const path = '/tags/'
8585
{contentPreview.map(item => (
8686
<article class="bg-[var(--color-theme-bg)] rounded-xl shadow-md hover:shadow-lg transition-all duration-300 hover:-translate-y-1 overflow-hidden group">
8787
<a
88-
href={`/${item.type === 'case-study' ? 'case-studies' : item.type === 'service' ? 'services' : 'articles'}/${item.id}/`}
88+
href={`/${item.type === 'case-study' ? 'case-studies' : item.type === 'service' ? 'services' : 'articles'}/${item.id}`}
8989
class="block h-full"
9090
>
9191
{'image' in item.data && item.data.image && (
@@ -150,7 +150,7 @@ const path = '/tags/'
150150
{contentPreview.slice(0, 1).map(item => (
151151
<article class="bg-[var(--color-theme-bg)] rounded-xl shadow-md hover:shadow-lg transition-all duration-300 hover:-translate-y-1 overflow-hidden group">
152152
<a
153-
href={`/${item.type === 'case-study' ? 'case-studies' : item.type === 'service' ? 'services' : 'articles'}/${item.id}/`}
153+
href={`/${item.type === 'case-study' ? 'case-studies' : item.type === 'service' ? 'services' : 'articles'}/${item.id}`}
154154
class="block"
155155
>
156156
{'image' in item.data && item.data.image && (

0 commit comments

Comments
 (0)