diff options
author | June McEnroe <june@causal.agency> | 2020-04-23 15:41:44 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2020-04-23 15:41:44 -0400 |
commit | f8a3724f7c627ec604bfdc4c0651478be34ae2b8 (patch) | |
tree | e4f0a22141b743ea12265bfbb6d083a0f987e420 | |
parent | Add basic patch highlighting (diff) | |
download | bubger-f8a3724f7c627ec604bfdc4c0651478be34ae2b8.tar.gz bubger-f8a3724f7c627ec604bfdc4c0651478be34ae2b8.zip |
Add generate time footer
Diffstat (limited to '')
-rw-r--r-- | html.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/html.c b/html.c index b883414..b138e73 100644 --- a/html.c +++ b/html.c @@ -395,5 +395,18 @@ int htmlSubthreadClose(FILE *file) { } int htmlThreadClose(FILE *file) { - return templateRender(file, TEMPLATE(</main>), NULL, NULL); + const char *template = TEMPLATE( + </main> + <footer> + generated <time datetime="[time]">[time]</time> + </footer> + ); + time_t now = time(NULL); + char time[sizeof("0000-00-00T00:00:00Z")]; + strftime(time, sizeof(time), "%FT%TZ", gmtime(&now)); + struct Variable vars[] = { + { "time", time }, + {0}, + }; + return templateRender(file, template, vars, escapeXML); } |