Skip to content

Commit bec8b2b

Browse files
committed
fix routing priority for es/blog/tag/[tag]
1 parent e920a38 commit bec8b2b

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

β€Žsrc/pages/blog/tag/[tag]/[...page].astroβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const lang = defaultLang
1515
export const getStaticPaths: GetStaticPaths = async ({ paginate }) => {
1616
const blogEntries = (await getCollection('blog'))
1717
.filter(
18-
(entry) => entry.filePath && entry.filePath.match(/\/blog\/[^\/]+\.mdx?$/)
18+
(entry) => entry.filePath && entry.filePath.match(/\/blog\/[^\/]+\.mdx?$/) && entry.data.lang === defaultLang
1919
)
2020
.sort((a, b) => b.data.date.getTime() - a.data.date.getTime())
2121
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
import { getCollection, render } from 'astro:content'
33
import BlogLayout from '../../../layouts/BlogLayout.astro'
44
import CommunityLinks from '../../../components/blog/CommunityLinks.astro'
5+
import { defaultLang } from '../../../i18n/ui'
56
67
export async function getStaticPaths() {
78
const blogEntries = await getCollection('blog')
8-
const defaultLang = 'en'
9+
const defaultLanguage = defaultLang
910
1011
return blogEntries
11-
.filter((entry) => entry.data.lang !== defaultLang) // handle the case of missing data? or is that done automatically?
12+
.filter((entry) => entry.data.lang !== defaultLanguage) // handle the case of missing data? or is that done automatically?
1213
.map((entry) => {
1314
return {
1415
params: { id: entry.id, lang: entry.data.lang },
File renamed without changes.

0 commit comments

Comments
Β (0)