mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-13 14:31:10 -05:00
generate all month options xsearch
This commit is contained in:
parent
3f3e1efcd4
commit
a4915afb8a
|
|
@ -89,48 +89,39 @@ export const getStaticPaths: GetStaticPaths = async () => {
|
|||
orderBy: [{ year: "desc" }, { month: "desc" }],
|
||||
});
|
||||
|
||||
if (!mostRecentResult) return { paths: [], fallback: true };
|
||||
if (!mostRecentResult) return { paths: [], fallback: false };
|
||||
|
||||
return {
|
||||
paths: ["SZ", "TC", "RM", "CB"].map((mode) => ({
|
||||
params: {
|
||||
slug: ["" + mostRecentResult.year, "" + mostRecentResult.month, mode],
|
||||
},
|
||||
})),
|
||||
fallback: true,
|
||||
paths: getMonthOptions(mostRecentResult.month, mostRecentResult.year)
|
||||
.flatMap(({ month, year }) => [
|
||||
{
|
||||
params: {
|
||||
slug: [year, month, "SZ"],
|
||||
},
|
||||
},
|
||||
{
|
||||
params: {
|
||||
slug: [year, month, "TC"],
|
||||
},
|
||||
},
|
||||
{
|
||||
params: {
|
||||
slug: [year, month, "RM"],
|
||||
},
|
||||
},
|
||||
{
|
||||
params: {
|
||||
slug: [year, month, "CB"],
|
||||
},
|
||||
},
|
||||
])
|
||||
.concat({
|
||||
params: {
|
||||
slug: [],
|
||||
},
|
||||
}),
|
||||
fallback: false,
|
||||
};
|
||||
|
||||
// return {
|
||||
// paths: getMonthOptions(mostRecentResult.month, mostRecentResult.year)
|
||||
// .flatMap(({ month, year }) => [
|
||||
// {
|
||||
// params: {
|
||||
// slug: [year, month, "SZ"],
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// params: {
|
||||
// slug: [year, month, "TC"],
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// params: {
|
||||
// slug: [year, month, "RM"],
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// params: {
|
||||
// slug: [year, month, "CB"],
|
||||
// },
|
||||
// },
|
||||
// ])
|
||||
// .concat({
|
||||
// params: {
|
||||
// slug: [],
|
||||
// },
|
||||
// }),
|
||||
// fallback: false,
|
||||
// };
|
||||
};
|
||||
|
||||
export const getStaticProps: GetStaticProps<Props> = async ({ params }) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user