diff options
author | Alan Pearce | 2023-09-22 12:04:00 +0200 |
---|---|---|
committer | Alan Pearce | 2023-09-22 12:04:00 +0200 |
commit | a547891ea9eb30361ea297300efb0b7c85917e8b (patch) | |
tree | 05b206b6820fc7c6cd265cf2c291b316cef77bc9 /src | |
parent | 3a2d198d153efc8a69e7640f7dcde88207268ff3 (diff) | |
download | website-a547891ea9eb30361ea297300efb0b7c85917e8b.tar.lz website-a547891ea9eb30361ea297300efb0b7c85917e8b.tar.zst website-a547891ea9eb30361ea297300efb0b7c85917e8b.zip |
Markup content with more microformats
Diffstat (limited to 'src')
-rw-r--r-- | src/templates.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/templates.ts b/src/templates.ts index 50c45ab..1006e21 100644 --- a/src/templates.ts +++ b/src/templates.ts @@ -51,7 +51,10 @@ async function renderHomepage(posts: Array<Post>): Promise<string> { cheerio.load(await Bun.file("templates/index.html").text()), config.title, ); - $("#content").html(marked.parse(file.content)); + + $("body").addClass("h-card"); + $(".title").addClass("p-name").addClass("u-url"); + $("#content").html(await marked.parse(file.content)); const $feed = $(".h-feed"); const $tpl = $(".h-entry").remove(); @@ -74,6 +77,7 @@ async function renderPost(file: Post, content: string) { file.title, ); + $(".title").addClass("h-card p-author").attr("rel", "author"); $(".h-entry .dt-published") .attr("datetime", file.date.toISOString()) .text(file.date.toISOString().slice(0, 10)); @@ -102,6 +106,7 @@ async function renderListPage(tag: string, posts: Post[]) { ); const $feed = $(".h-feed"); const $tpl = $(".h-entry").remove(); + $(".title").addClass("p-author h-card").attr("rel", "author"); for (const post of posts) { const $post = $tpl.clone(); |