From cd52395ea0f186434a332d5cd201ccc94b4680e9 Mon Sep 17 00:00:00 2001 From: citrons Date: Wed, 29 Nov 2023 12:53:27 -0600 Subject: archival support --- zzcxz.cgi | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zzcxz.cgi b/zzcxz.cgi index 34b0c6e..9336bfc 100755 --- a/zzcxz.cgi +++ b/zzcxz.cgi @@ -143,6 +143,7 @@ local base = template [[

source code

+

archive

citrons.xyz

@@ -168,6 +169,8 @@ local function parse_directive(line, directives, tmp_flags) local redirect = args:match "^%s*(%w%w%w%w%w)%s*$" if not redirect then return end directives.redirect = redirect + elseif directive == "deadend" then + directives.deadend = true elseif directive == "set" then if args:match "^%s*$" then return end local flagname, text = args:match "^%s*([%w%-_]+)%s*(.-)%s*$" @@ -278,6 +281,8 @@ local function parse_page(s) table.insert(content, line:sub(2)) elseif line:match("^!image") then page.illustration = line:match "^!image%s+(%w+)" + elseif line:match("^!archive") then + page.archive = true else local target, action = line:match "^(%w%w%w%w%w):(.-)\n$" if action then @@ -418,7 +423,7 @@ map["^/g/(%w%w%w%w%w)$"] = function(p) html_encode(a.target), html_encode(a.action))) end end - if not directives.deadend then + if not directives.deadend and not page.archive then table.insert(actions, ([[
  • -- cgit v1.2.3