@@ -159,7 +153,11 @@ const pageTitle: string = `${post.data.title} | ${SITE.title}`;
- {relatedPosts.map((entry) => )}
+ {
+ relatedPosts.map((entry) => (
+
+ ))
+ }
diff --git a/src/pages/fr/blog/index.astro b/src/pages/fr/blog/index.astro
index 7fb1128..522fff5 100644
--- a/src/pages/fr/blog/index.astro
+++ b/src/pages/fr/blog/index.astro
@@ -108,7 +108,7 @@ const pageTitle: string = `Blog | ${SITE.title}`;
{
insightPosts.map((insightEntry) => (
-
+
))
}
diff --git a/src/pages/fr/insights/[...slug].astro b/src/pages/fr/insights/[...slug].astro
index fb70622..26422e0 100644
--- a/src/pages/fr/insights/[...slug].astro
+++ b/src/pages/fr/insights/[...slug].astro
@@ -7,11 +7,14 @@ import { getCollection } from "astro:content";
// Use `getStaticPaths` to generate static routes for generated pages on build
export async function getStaticPaths() {
- const insightPosts = await getCollection("insights");
- return insightPosts.map((post) => ({
- params: { slug: post.slug },
- props: { post },
- }));
+ const insightPosts = await getCollection("insights", ({ id }) => id.startsWith("fr/"));
+ return insightPosts.map((post) => {
+ const slugWithoutLang = post.slug.replace(/^fr\//, ''); // Remove the "fr/" prefix
+ return {
+ params: { lang: 'fr', slug: slugWithoutLang },
+ props: { post },
+ };
+ });
}
// Get the props for this page that define a specific insight post
diff --git a/src/pages/fr/products/[...slug].astro b/src/pages/fr/products/[...slug].astro
index 04f0c71..8b78cc4 100644
--- a/src/pages/fr/products/[...slug].astro
+++ b/src/pages/fr/products/[...slug].astro
@@ -14,14 +14,18 @@ declare global {
}
}
// This gets the static paths for all the unique products
+
export async function getStaticPaths() {
- const productEntries = await getCollection("products", ({ id }) => {
- return id.startsWith("fr/");
+ const productEntries = await getCollection("products", ({ id }) =>
+ id.startsWith("fr/")
+ );
+ return productEntries.map((product) => {
+ const slugWithoutLang = product.slug.replace(/^fr\//, ""); // Remove the "fr/" prefix
+ return {
+ params: { lang: "fr", slug: slugWithoutLang },
+ props: { product },
+ };
});
- return productEntries.map((product) => ({
- params: { slug: product.slug },
- props: { product },
- }));
}
const { product } = Astro.props;
diff --git a/src/pages/insights/[...slug].astro b/src/pages/insights/[...slug].astro
index fb70622..e733869 100644
--- a/src/pages/insights/[...slug].astro
+++ b/src/pages/insights/[...slug].astro
@@ -7,11 +7,16 @@ import { getCollection } from "astro:content";
// Use `getStaticPaths` to generate static routes for generated pages on build
export async function getStaticPaths() {
- const insightPosts = await getCollection("insights");
- return insightPosts.map((post) => ({
- params: { slug: post.slug },
- props: { post },
- }));
+ const insightPosts = await getCollection("insights", ({ id }) =>
+ id.startsWith("en/")
+ );
+ return insightPosts.map((post) => {
+ const slugWithoutLang = post.slug.replace(/^en\//, ""); // Remove the "fr/" prefix
+ return {
+ params: { slug: slugWithoutLang },
+ props: { post },
+ };
+ });
}
// Get the props for this page that define a specific insight post
diff --git a/src/pages/products/[...slug].astro b/src/pages/products/[...slug].astro
index e81bb04..3531558 100644
--- a/src/pages/products/[...slug].astro
+++ b/src/pages/products/[...slug].astro
@@ -15,14 +15,18 @@ declare global {
}
// This gets the static paths for all the unique products
+
export async function getStaticPaths() {
- const productEntries = await getCollection("products", ({ id }) => {
- return id.startsWith("en/");
+ const productEntries = await getCollection("products", ({ id }) =>
+ id.startsWith("en/")
+ );
+ return productEntries.map((product) => {
+ const slugWithoutLang = product.slug.replace(/^en\//, ""); // Remove the "en/" prefix
+ return {
+ params: { slug: slugWithoutLang },
+ props: { product },
+ };
});
- return productEntries.map((product) => ({
- params: { slug: product.slug },
- props: { product },
- }));
}
const { product } = Astro.props;