commit 5ad9984572c510223858b2969aeb4aa77659b958 parent c4d41fe757dbbde3c71f66d5bbbbf416608a3e2c Author: Drew DeVault <sir@cmpwn.com> Date: Wed, 21 Apr 2021 10:07:52 -0400 haredoc: fix <title> for stdlib index Diffstat:
M | cmd/haredoc/html.ha | | | 9 | ++++++++- |
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/cmd/haredoc/html.ha b/cmd/haredoc/html.ha @@ -398,11 +398,18 @@ fn head(ident: ast::ident) (void | error) = { let breadcrumb = breadcrumb(ident); defer free(breadcrumb); + const title = + if (len(id) == 0) + fmt::asprintf("Hare documentation") + else + fmt::asprintf("{} — Hare documentation", id); + defer free(title); + // TODO: Move bits to +embed? fmt::printfln("<!doctype html> <html lang='en'> <meta charset='utf-8' /> -<title>{} — Hare documentation</title>", id)?; +<title>{}</title>", title)?; fmt::println("<style> body { font-family: sans-serif;