Skip to content

Commit

Permalink
feat: biweekly summary
Browse files Browse the repository at this point in the history
  • Loading branch information
scarf005 committed Mar 26, 2024
1 parent 0333892 commit 3a0e9ef
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions index.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,25 @@ export default function* ({ search }: Lume.Data, { md }: Lume.Helpers) {
`
})

const latestContent =
maxWith(weekly, (a, b) => Temporal.PlainDate.compare(a.latest, b.latest))!.content
const last14days = pages
.toSorted((a, b) => Temporal.PlainDate.compare(toPlainDate(b.date), toPlainDate(a.date)))
.slice(0, 14)

yield {
lang,
url: `/${lang}/`,
title: "최근 변경 내역",
content: latestContent,
content: /*html*/ `
<main>
<header>
<h1>${
localeFormatter.formatRange(last14days.at(-1)!.date, last14days.at(0)!.date)
}</h1>
</header>
<hr />
${last14days.map(article(md)).join("\n")}
</main>
`,
}
yield {
lang,
Expand Down

0 comments on commit 3a0e9ef

Please sign in to comment.