Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
andyluss committed Dec 26, 2024
1 parent 8a9e237 commit eb29b17
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 3 additions & 5 deletions src/pages/lab/filter/[filter].astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ import IndexLayout from "../../../layouts/IndexLayout.astro";
export async function getStaticPaths() {
const { tags, levels } = await getAll("lab");
return levels
.map((level) =>
tags.map((tag) => ({ params: { filter: `${level[0]}-${tag[0]}` } })),
)
.flat();
return levels.flatMap((level) =>
tags.map((tag) => ({ params: { filter: `${level[0]}-${tag[0]}` } })),
);
}
const { filter } = Astro.params;
Expand Down
8 changes: 3 additions & 5 deletions src/pages/xyy/filter/[filter].astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ import IndexLayout from "../../../layouts/IndexLayout.astro";
export async function getStaticPaths() {
const { tags, levels } = await getAll("xyy");
return levels
.map((level) =>
tags.map((tag) => ({ params: { filter: `${level[0]}-${tag[0]}` } })),
)
.flat();
return levels.flatMap((level) =>
tags.map((tag) => ({ params: { filter: `${level[0]}-${tag[0]}` } })),
);
}
const { filter } = Astro.params;
Expand Down

0 comments on commit eb29b17

Please sign in to comment.