Skip to content

Commit

Permalink
fix: editorial contest id (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
kiwiyou authored Nov 1, 2024
1 parent c8bf541 commit 37ef863
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/pages/editorial/[...slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,13 @@ export const getStaticPaths = (async () => {
}))
}) satisfies GetStaticPaths
const { slug } = Astro.params
const { entry } = Astro.props
const [year, month, tag, index] = slug.split("/")
const id = `${year}-${month}-${tag}`
const collection = await getContests()
const { data: contest } = collection.find(
({ id: contestId }) => contestId === id,
({ id }) => id === entry.data.contest,
)!
const { number, title } = contest.problems[+index]
const index = +entry.data.index
const { number, title } = contest.problems[index]
const path = [
{
name: "",
Expand All @@ -41,7 +39,7 @@ const path = [
},
] satisfies Path
const author = contest.authors?.[+index]
const author = contest.authors?.[index]
const { Content } = await render(entry)
---

Expand Down

0 comments on commit 37ef863

Please sign in to comment.