Skip to content

Commit

Permalink
refactor: locale
Browse files Browse the repository at this point in the history
  • Loading branch information
nickfrosty committed Sep 10, 2024
1 parent d6c7d0f commit 3f5db28
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 7 deletions.
5 changes: 4 additions & 1 deletion src/pages/developers/cookbook/[[...slug]].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ export async function getStaticProps({ params, locale }) {
if (!!redirect) return redirect;

// serialize the content via mdx
const source = await serializeMarkdown(record.body, record?.id);
const source = await serializeMarkdown(
record.body,
`${locale}-${record?.id}`,
);

// load the nav data
const navData = await ContentApi.getNavForGroup("cookbook", locale);
Expand Down
5 changes: 4 additions & 1 deletion src/pages/developers/courses/[course]/[lesson]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ export async function getStaticProps({ params, locale }) {
if (!!redirect) return redirect;

// serialize the content via mdx
const source = await serializeMarkdown(record.body || "", record?.id);
const source = await serializeMarkdown(
record.body || "",
`${locale}-${record?.id}`,
);

return {
props: {
Expand Down
5 changes: 4 additions & 1 deletion src/pages/developers/guides/[...slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ export async function getStaticProps({ params, locale }) {
if (!!redirect) return redirect;

// serialize the content via mdx
const source = await serializeMarkdown(record.body || "", record?.id);
const source = await serializeMarkdown(
record.body || "",
`${locale}-${record?.id}`,
);

return {
props: {
Expand Down
5 changes: 4 additions & 1 deletion src/pages/developers/resources/[...slug].jsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ export async function getStaticProps({ params, locale }) {
if (!!redirect) return redirect;

// serialize the content via mdx
const source = await serializeMarkdown(record.body || "", record?.id);
const source = await serializeMarkdown(
record.body || "",
`${locale}-${record?.id}`,
);

return {
props: {
Expand Down
5 changes: 4 additions & 1 deletion src/pages/docs/[[...slug]].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ export async function getStaticProps({ params, locale }) {
if (!!redirect) return redirect;

// serialize the content via mdx
const source = await serializeMarkdown(record.body, record?.id);
const source = await serializeMarkdown(
record.body,
`${locale}-${record?.id}`,
);

// load the nav data
const navData = await ContentApi.getNavForGroup("docs", locale);
Expand Down
5 changes: 4 additions & 1 deletion src/pages/docs/rpc/[[...slug]].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,10 @@ export async function getStaticProps({ params, locale }) {
if (!!redirect) return redirect;

// serialize the content via mdx
const source = await serializeMarkdown(record.body, record?.id);
const source = await serializeMarkdown(
record.body,
`${locale}-${record?.id}`,
);

// load the nav data
const navData = await ContentApi.getNavForGroup("docs/rpc", locale);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export async function serializeMarkdown(
},
});
} catch (err) {
console.error("[serializeMarkdown]", docKey);
console.error("[ERROR] [serializeMarkdown]", docKey);
console.error(err);
return await serialize(
"There was an unknown error while processing the markdown content. \n\n" +
Expand Down

0 comments on commit 3f5db28

Please sign in to comment.