diff options
author | the lemons <citrons@mondecitronne.com> | 2022-05-25 01:11:00 -0500 |
---|---|---|
committer | the lemons <citrons@mondecitronne.com> | 2022-05-25 01:11:00 -0500 |
commit | 70411657215f7cbe760bee200dcb189855136a14 (patch) | |
tree | dbb67f46c0e59f7c22ef5a155b22e53f1a0773cb | |
parent | 144ab28c99e93ff5040fb5361fe8b13fe1259e03 (diff) |
new homepage
-rw-r--r-- | static/amethyst.css | 12 | ||||
-rw-r--r-- | static/zzcxz.png | bin | 0 -> 62795 bytes | |||
-rwxr-xr-x | zzcxz.cgi | 41 |
3 files changed, 48 insertions, 5 deletions
diff --git a/static/amethyst.css b/static/amethyst.css index a6f22c1..fcb8d62 100644 --- a/static/amethyst.css +++ b/static/amethyst.css @@ -316,3 +316,15 @@ pre { pre > code { color: black; } + +main.index { + display: flex; + align-items: center; + flex-wrap: wrap; + justify-content: center; +} + +.index .logo { + min-width: 25%; + max-width: 50%; +} diff --git a/static/zzcxz.png b/static/zzcxz.png Binary files differnew file mode 100644 index 0000000..8076f54 --- /dev/null +++ b/static/zzcxz.png @@ -138,7 +138,7 @@ local base = template [[ <main>$content</main> <footer> <div class="links"> - <p><a href="/g/zzcxz">back to start</a></p> + <p><a href="/">zzcxz</a></p> <p><a href="/about">help</a></p> <p><a href="https://citrons.xyz/git/zzcxz.git/about"> source code @@ -643,6 +643,14 @@ map["^/g/(%w%w%w%w%w)/raw$"] = function(p) } end +map["^/g/?$"] = function() + if #history > 0 then + return redirect('/g/'..history[#history]) + else + return redirect '/g/zzcxz' + end +end + map["^/about/?$"] = function() return assert(io.open("about.html", 'r')) end @@ -652,12 +660,35 @@ map["^/robots.txt$"] = function() { content_type = 'text/plain' } end +local index_template = template [[ +<!doctype html> +<html> + <head> + <link rel="stylesheet" href="/static/amethyst.css" /> + <meta charset="utf-8" /> + <title>zzcxz</title> + <meta name="viewport" content="width=device-width, initial-scale=1"> + </head> + <body> + <main class="index"> + <img class="logo" src="/static/zzcxz.png" alt="zzcxz" /> + <ul class="actions"> + $actions + <li><a href="/about">help</a></li> + </ul> + </main> + </body> +</html> +]] map["^/$"] = function() - if #history > 0 then - return redirect('/g/'..history[#history]) - else - return redirect '/g/zzcxz' + local last_page = + load_page(history[#history] or 'zzcxz') or load_page 'zzcxz' + local actions = ('<li><a href="/g/%s" class="important">%s</a></li>') + :format(last_page.id, html_encode(last_page.title)) + if last_page.id ~= 'zzcxz' then + actions = actions .. '<li><a href="/g/zzcxz">reenter the zzcxz</a></li>' end + return index_template {actions = actions} end local function main() |