import { readFileSync } from "node:fs"; import { BasePage } from "./bases.js"; import type { Page } from "./types.js"; interface LinkData { title: string, url: string, tags: string[], description?: string, read?: string, author?: string, } interface Data { links: LinkData[]; to_read: string[], authors: Record; } function Link(props: { link: LinkData }) { const link = props.link; return <> {link.title} {" "} {link.tags.join(", ")} } const data: Data = eval(`(${readFileSync("content/links.jsonc", "utf8")})`); data.links.pop(); // Remove template at the end const title = "Links!"; export const links: Page = { title, ref: "/links.html", content:

{title}

    { data.links.map(link =>
  • )}
}