From 7a85cb1010051d5b5460e511ce010e23e644cb04 Mon Sep 17 00:00:00 2001 From: dvs1 Date: Sat, 28 Dec 2024 16:55:42 +1000 Subject: Mostly fix up the footer. Still could use an " and " between "atom feed" and "source code" if both are there. --- INSTALL.md | 2 +- README | 2 +- TODO.md | 4 +--- about/index.md | 4 +--- default.template | 29 +++++------------------------ notYetAnotherWiki.lua | 11 ++++++++++- testing/index.md | 4 +--- 7 files changed, 20 insertions(+), 36 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 596f8bf..7eabf39 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,7 +1,7 @@ --- pagetitle: "INSTALL" author: onefang -history: https://sledjhamr.org/cgit/notYetAnotherWiki/log/INSTALL.md +pagehistory: https://sledjhamr.org/cgit/notYetAnotherWiki/log/INSTALL.md --- notYetAnotherWiki uses [lcmark](https://github.com/jgm/lcmark) to parse [CommonMark](https://commonmark.org/) into HTML. You can probably install it using luarocks. lua-yaml is the YAML parsing library I test with. diff --git a/README b/README index 29e3b63..444578e 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ --- pagetitle: "notYetAnotherWiki" author: onefang -history: https://sledjhamr.org/cgit/notYetAnotherWiki/log/index.md +pagehistory: https://sledjhamr.org/cgit/notYetAnotherWiki/log/index.md --- notYetAnotherWiki is not another wiki, at least not yet. It'll be much diff --git a/TODO.md b/TODO.md index f809490..1a87d89 100644 --- a/TODO.md +++ b/TODO.md @@ -1,12 +1,10 @@ --- pagetitle: "TODO" author: onefang -history: https://sledjhamr.org/cgit/notYetAnotherWiki/log/TODO.md +pagehistory: https://sledjhamr.org/cgit/notYetAnotherWiki/log/TODO.md --- ## Do these -Footer is still wrong. - Clean up the favicon and logo stuff. Have one in a root directory that the pages in sub directories point to, instead of the current symlinks. Apply the same solution to default.template. diff --git a/about/index.md b/about/index.md index 6e2b5e2..1b9be48 100644 --- a/about/index.md +++ b/about/index.md @@ -1,9 +1,7 @@ --- pagetitle: "notYetAnotherWiki is not another wiki, at least not yet. It'll be much more than that, eventually." author: onefang -feedatom: https://sledjhamr.org/cgit/notYetAnotherWiki/atom -history: https://sledjhamr.org/cgit/notYetAnotherWiki/log/About/index.md -sourcecode: https://sledjhamr.org/cgit/notYetAnotherWiki/ +pagehistory: https://sledjhamr.org/cgit/notYetAnotherWiki/log/About/index.md --- This is a new directory, an entire PR department can hang out here. diff --git a/default.template b/default.template index 592813a..fba6ef4 100644 --- a/default.template +++ b/default.template @@ -9,11 +9,6 @@ @@ -38,31 +29,21 @@ $header$   plus login and register buttons   - - $menu$ - - -

👣 $trail$

- + $menu$ +

👣 $trail$

-
-
+

$pagetitle$

Author: $author$ $body$ -
- -

Page history

- - -

Web site atom feed and source code   Powered by notYetAnotherWiki Version $version$.  

- + $history$ + $footer$ diff --git a/notYetAnotherWiki.lua b/notYetAnotherWiki.lua index 37bbd94..2faf285 100755 --- a/notYetAnotherWiki.lua +++ b/notYetAnotherWiki.lua @@ -4,7 +4,11 @@ local lcmark = require("lcmark") -local globalData = {favicon = 'nYAW_icon.png', logo = 'nYAW.png', version = '-0.1', header = '', footer = '', menu = '', ['_'] = ' ', ['dlr'] = '$', ['karenpurple'] = '#8800ff'} +local globalData = { + ['_'] = ' ', ['dlr'] = '$', ['karenpurple'] = '#8800ff', + favicon = 'nYAW_icon.png', logo = 'nYAW.png', header = '', menu = '', + history = '', footer = 'Powered by notYetAnotherWiki Version -0.1.  ', +} local sites = {} @@ -170,6 +174,11 @@ for k, v in pairs(sites) do trail = trail .. w.name metadata.trail = trail + if nil ~= metadata.pagehistory then metadata.history = '

Page history

' end + if nil ~= metadata.sourcecode then metadata.footer = 'source code     ' .. metadata.footer end + if nil ~= metadata.feedatom then metadata.footer = 'atom feed     ' .. metadata.footer end + if metadata.footer ~= globalData.footer then metadata.footer = 'Web site ' .. metadata.footer end + metadata.footer = '

' .. metadata.footer .. '

' metadata.body = lcmark.apply_template(bod, metadata) local tm = '' diff --git a/testing/index.md b/testing/index.md index ea098d7..f926155 100644 --- a/testing/index.md +++ b/testing/index.md @@ -1,9 +1,7 @@ --- pagetitle: "G'day world!" author: onefang -feedatom: https://sledjhamr.org/cgit/notYetAnotherWiki/atom -history: https://sledjhamr.org/cgit/notYetAnotherWiki/log/testing/index.md -sourcecode: https://sledjhamr.org/cgit/notYetAnotherWiki/ +pagehistory: https://sledjhamr.org/cgit/notYetAnotherWiki/log/testing/index.md --- I've been around since the early sixties, but no one ever noticed.  You -- cgit v1.1