Skip to content

Commit

Permalink
fix: breadcrumb type
Browse files Browse the repository at this point in the history
  • Loading branch information
phvm committed Oct 14, 2024
1 parent 4322093 commit c958dfe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/pages/docs/tracks/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,8 @@ export const getStaticProps: GetStaticProps = async ({
parentsArray,
parentsArrayName,
parentsArrayType,
'tracks'
'tracks',
locale
)

return {
Expand Down
7 changes: 4 additions & 3 deletions src/utils/getBreadcrumbsList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ export function getBreadcrumbsList(
parents: string[],
parentsNames: string[],
parentsTypes: string[],
docsType: 'tutorial' | 'tracks'
docsType: 'tutorial' | 'tracks',
locale?: string
) {
const breadcrumbs: { slug: string; name: string; type: string }[] = []
parentsNames.forEach((_el: string, idx: number) => {
breadcrumbs.push({
slug: `/docs/${docsType}/${parents[idx]}`,
slug: `${locale}/docs/${docsType}/${parents[idx]}`,
name: parentsNames[idx],
type: parentsTypes[idx],
type: parentsTypes[idx] || 'defaultType',
})
})
return breadcrumbs
Expand Down

0 comments on commit c958dfe

Please sign in to comment.