diff options
| author | Robert Günzler <r@gnzler.io> | 2024-10-15 16:33:47 +0200 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2024-10-16 15:40:15 +0200 |
| commit | 9b3eb6d00077319a8da82d65c77dd501e21f52d5 (patch) | |
| tree | 273a1b120ba7cc974cab1fae9a739f4b631121f9 | |
| parent | fd604f14e28cc89947fd60cd4a8abdb40ccf43a0 (diff) | |
| download | site-9b3eb6d00077319a8da82d65c77dd501e21f52d5.tar.gz | |
allow setting license stuff from global variables
Signed-off-by: Robert Günzler <r@gnzler.io>
| -rw-r--r-- | src/main.zig | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/main.zig b/src/main.zig index b5a6967..6cf86a5 100644 --- a/src/main.zig +++ b/src/main.zig @@ -10,10 +10,12 @@ const PAGE_PATH = "src/inc"; const SITE_ROOT = "."; const SITE_PATH = "site"; -const DOMAIN_URL = "https://example.com"; -const SITE_NAME = "example"; -const LICENSE_URL = "https://example.com/license"; -const SOURCE_URL = "https://example.com/source"; +const DOMAIN_URL = "https://gzr.im"; +const SITE_NAME = "gzr.im"; +const LICENSE_HOLDER = "robertgzr"; +const LICENSE_NAME = "BY-NC-SA 4.0"; +const LICENSE_URL = "https://git.sr.ht/~robertgzr/site/blob/rabbits/LICENSE.content"; +const SOURCE_URL = "https://git.sr.ht/~robertgzr/site/tree/rabbits"; const BuildErrors = (std.fs.File.OpenError || std.fs.File.WriteError || std.mem.Allocator.Error); @@ -210,17 +212,19 @@ fn build(allocator: std.mem.Allocator, f: std.fs.File, page_name: []const u8, sr try f.writer().print( \\<footer> \\<span style=""> - \\Edited on {[MTIME]s} <a href="{[SOURCE]s}/{[PATH]s}">[edit]</a><br/> - \\</span> - \\<b>robertgzr</b> © — - \\<a href="{[LICENSE]s}" target="_blank">BY-NC-SA 4.0</a> + \\Edited on {[MTIME]s} <a href="{[SOURCE_URL]s}/{[PATH]s}">[edit]</a> + \\</span><br/> + \\<b>{[LICENSE_HOLDER]s}</b> — + \\<a href="{[LICENSE_URL]s}" target="_blank">{[LICENSE_NAME]s}</a> \\</footer> \\</body></html> , .{ .MTIME = mtime, .PATH = srcpath, - .LICENSE = LICENSE_URL, - .SOURCE = SOURCE_URL, + .LICENSE_HOLDER = LICENSE_HOLDER, + .LICENSE_NAME = LICENSE_NAME, + .LICENSE_URL = LICENSE_URL, + .SOURCE_URL = SOURCE_URL, }); } |