diff options
author | citrons <citrons@mondecitronne.com> | 2023-11-29 12:53:27 -0600 |
---|---|---|
committer | citrons <citrons@mondecitronne.com> | 2023-11-29 12:53:27 -0600 |
commit | cd52395ea0f186434a332d5cd201ccc94b4680e9 (patch) | |
tree | 4eda7ee934b9f58eb8a9c7e6358db9df98bad260 | |
parent | cda6584b7b48f8366e215a72c1ccc62aeb37dfac (diff) |
archival support
-rwxr-xr-x | zzcxz.cgi | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -143,6 +143,7 @@ local base = template [[ <p><a href="https://citrons.xyz/git/zzcxz.git/about"> source code </a></p> + <p><a href="/g/zzcxy">archive</a></p> <p><a href="https://citrons.xyz">citrons.xyz</a></p> </div> </footer> @@ -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, ([[ <li> |