about summary refs log tree commit diff
path: root/html.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--html.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/html.c b/html.c
index 352e229..677bed0 100644
--- a/html.c
+++ b/html.c
@@ -102,7 +102,7 @@ static char *htmlMbox(const struct Envelope *envelope) {
 
 int htmlMessageOpen(FILE *file, const struct Envelope *envelope) {
 	// TODO: Conditionally include mailto: link.
-	const char *template1 = TEMPLATE(
+	const char *template = TEMPLATE(
 		<article class="message" id="[messageID]">
 		<header>
 			<h2>[subject]</h2>
@@ -110,15 +110,12 @@ int htmlMessageOpen(FILE *file, const struct Envelope *envelope) {
 				<a href="[mailto]">[from]</a>
 			</address>
 			<time datetime="[utc]">[date]</time>
-	);
-	const char *template2 = TEMPLATE(
 			<nav>
 				<ul>
 					<li><a href="[fragment]">permalink</a></li>
 					<li><a href="[mbox]">mbox</a></li>
 				</ul>
 			</nav>
-		</header>
 	);
 	char *mailto = htmlMailto(envelope);
 	char utc[sizeof("0000-00-00T00:00:00Z")];
@@ -137,10 +134,10 @@ int htmlMessageOpen(FILE *file, const struct Envelope *envelope) {
 		{0},
 	};
 	int error = 0
-		|| templateRender(file, template1, vars, escapeXML)
+		|| templateRender(file, template, vars, escapeXML)
 		|| htmlAddressList(file, "to", envelope->to)
 		|| htmlAddressList(file, "cc", envelope->cc)
-		|| templateRender(file, template2, vars, escapeXML);
+		|| templateRender(file, TEMPLATE(</header>), NULL, NULL);
 	free(mailto);
 	free(fragment);
 	free(mbox);