From fe250aa344626b2e6283afd2c31979dccd327778 Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Thu, 30 Apr 2026 16:42:32 +0200 Subject: Fix HTML --- extras/estampa.sh | 3 +++ src/render.rs | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/extras/estampa.sh b/extras/estampa.sh index 53a705a..46cca53 100644 --- a/extras/estampa.sh +++ b/extras/estampa.sh @@ -65,6 +65,9 @@ estampaste() { rm -f "$tmp" return 1 fi + # mktemp creates 600; scp preserves source mode, so without this + # the upload lands unreadable to the nginx user. + chmod 644 "$tmp" if ! scp -q "$tmp" "$host:./$name"; then rm -f "$tmp" diff --git a/src/render.rs b/src/render.rs index 8e366dd..878cefa 100644 --- a/src/render.rs +++ b/src/render.rs @@ -17,13 +17,13 @@ pub fn page(path: &Path, text: &str) -> String { let body = highlight(path, text); let mut out = String::with_capacity(body.len() + 256); - out.push_str("\n\n"); + out.push_str("<!doctype html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<title>"); push_escaped(&mut out, title); out.push_str("\n\n"); + out.push_str("\n\n\n"); out.push_str(&body); - out.push('\n'); + out.push_str("\n\n\n"); out } -- cgit