about summary refs log tree commit diff
path: root/src/main.zig
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/main.zig16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/main.zig b/src/main.zig
index 7d33020..c40215e 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -221,10 +221,10 @@ fn build(allocator: std.mem.Allocator, f: std.fs.File, page_name: []const u8, sr
         \\<span style="">
         \\Edited on {[MTIME]s} <a href="{[SOURCE_URL]s}/{[PATH]s}">[edit]</a>
         \\</span><br/>
-        \\<b>{[LICENSE_HOLDER]s}</b> &mdash;
+        \\<b>{[LICENSE_HOLDER]s}</b>
+        \\&mdash;
         \\<a href="{[LICENSE_URL]s}" target="_blank">{[LICENSE_NAME]s}</a>
         \\</footer>
-        \\</body></html>
     , .{
         .MTIME = mtime,
         .PATH = srcpath,
@@ -233,6 +233,18 @@ fn build(allocator: std.mem.Allocator, f: std.fs.File, page_name: []const u8, sr
         .LICENSE_URL = LICENSE_URL,
         .SOURCE_URL = SOURCE_URL,
     });
+
+    const n = f.getPos() catch 0;
+    if (n > 5000)
+        try f.writer().writeAll(
+            \\<a href="#top">[&#9206;]</a>
+            \\
+        );
+
+    try f.writer().writeAll(
+        \\</body></html>
+        \\
+    );
 }
 
 fn meta(ctx: *Context, p: []const u8) !void {