Skip to content

Commit 90269e8

Browse files
committed
fix: need to handle locale and non-locale
1 parent 8ac315b commit 90269e8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/reo-script.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ const ReoScript = () => {
1818
}
1919

2020
// Handle blog post filtering
21-
const blogPathMatch = pathname.match(/^\/[^/]+\/blog\/([^/]+)$/);
21+
// Regex handles both URL formats: /blog/slug (default locale) and /locale/blog/slug (non-default locale)
22+
const blogPathMatch = pathname.match(/^(?:\/[^/]+)?\/blog\/([^/]+)$/);
2223
if (blogPathMatch) {
2324
const slug = blogPathMatch[1];
2425
// Use pre-generated mapping for instant lookup

0 commit comments

Comments
 (0)