feat: Added comment support.

This commit is contained in:
Spencer Brower
2026-07-11 10:39:07 -04:00
parent c3efbf80f0
commit d10b832f3f
2 changed files with 14 additions and 2 deletions
-1
View File
@@ -15,4 +15,3 @@
- [ ] Nix build integration — main flake runs thor + tailwindcss instead of Hugo
- [ ] Copy-to-clipboard button on code blocks (was in Hugo's custom-head.html)
- [ ] OpenGraph meta tags
- [ ] utteranc.es comments on posts
+14 -1
View File
@@ -66,17 +66,30 @@ render_site :: proc(pages: []Page, content_path: string, output_dir: string, bas
}
render_page_html :: proc(page: Page, site_title: string) -> string {
comments := ""
if page.type == .Post {
comments = `
<script src="https://utteranc.es/client.js"
repo="sbrow/sbrow.github.io"
issue-term="pathname"
label="Comment"
theme="github-dark"
crossorigin="anonymous"
async></script>`
}
body := fmt.aprintf(
`<main>
<article class="prose">
<h1>%s</h1>
%s %s
</article>
</article>%s
</main>
`,
page.title,
render_date(page),
page.body_html,
comments,
)
title := fmt.tprintf("%s | %s", page.title, site_title)
return render_chrome(title, body)