From 5d489e505cd721e6bebfe3c825c0823a1a3a78ca Mon Sep 17 00:00:00 2001 From: dvs1 Date: Sat, 15 Mar 2025 17:42:21 +1000 Subject: Implement page history for Fos and Pm, and clean up the edit line. --- notYetAnotherWiki.lua | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'notYetAnotherWiki.lua') diff --git a/notYetAnotherWiki.lua b/notYetAnotherWiki.lua index e389e74..4cf091e 100755 --- a/notYetAnotherWiki.lua +++ b/notYetAnotherWiki.lua @@ -804,8 +804,17 @@ for name, file in pairs(Files) do end -- Figure out this pages footer links. + local temp = '' metadata.footer = '' - if nil ~= metadata.pagehistory then metadata.history = '
Page history
' else metadata.history = '' end + if nil == metadata.pagehistory then + if 'Foswiki' == metadata.ogWiki then metadata.pagehistory = metadata.ogURL .. '/bin/oops/' .. metadata.ogBase .. '/' .. metadata.ogFile .. '?template=oopshistory' end + if 'PmWiki' == metadata.ogWiki then metadata.pagehistory = metadata.ogURL .. '/?n=' .. metadata.ogBase .. '.' .. metadata.ogFile .. '?action=diff' end + else + temp = '/' .. name .. '.md' + end + if nil ~= metadata.pagehistory then metadata.history = 'Page history
' else + metadata.history = '' + end if nil ~= metadata.sourcecode then metadata.footer = 'source code' end if nil ~= metadata.feedatom then metadata.footer = 'atom feed ' .. metadata.footer end if metadata.footer ~= '' then metadata.footer = 'Web site ' .. metadata.footer end @@ -814,10 +823,10 @@ for name, file in pairs(Files) do local title, link = whichWiki(metadata) link = string.gsub(link, 'https://', 'HTTPS://') -- Prevent this one from being converted. -- TODO - wrap "edit" in a link to actually edit it. PmWiki "?action=edit" Foswiki "https://fos.wiki.devuan.org/bit/edit/" .. page .. "?t=" .. 10 digit random number? - local edit = 'edit' - if 'PmWiki' == metadata.ogWiki then edit = 'edit' end --- if 'Foswiki' == metadata.ogWiki then edit = 'edit' end - metadata.footer = 'Original page, maybe you can ' .. edit .. ' it. ' .. metadata.footer + local edit = 'T' + if 'PmWiki' == metadata.ogWiki then edit = 'Maybe you can edit t' end +-- if 'Foswiki' == metadata.ogWiki then edit = '' end + metadata.footer = edit .. 'he original page. ' .. metadata.footer end metadata.footer = '' .. metadata.footer .. '
' -- cgit v1.1