diff options
author | dvs1 | 2025-03-15 17:42:21 +1000 |
---|---|---|
committer | dvs1 | 2025-03-15 17:42:21 +1000 |
commit | 5d489e505cd721e6bebfe3c825c0823a1a3a78ca (patch) | |
tree | ca64bea1155c9a06da3ed328617c51e4e102da4d /notYetAnotherWiki.lua | |
parent | Adjust the test text for the list bug. (diff) | |
download | notYetAnotherWiki-5d489e505cd721e6bebfe3c825c0823a1a3a78ca.zip notYetAnotherWiki-5d489e505cd721e6bebfe3c825c0823a1a3a78ca.tar.gz notYetAnotherWiki-5d489e505cd721e6bebfe3c825c0823a1a3a78ca.tar.bz2 notYetAnotherWiki-5d489e505cd721e6bebfe3c825c0823a1a3a78ca.tar.xz |
Implement page history for Fos and Pm, and clean up the edit line.
Diffstat (limited to 'notYetAnotherWiki.lua')
-rwxr-xr-x | notYetAnotherWiki.lua | 19 |
1 files changed, 14 insertions, 5 deletions
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 | |||
804 | end | 804 | end |
805 | 805 | ||
806 | -- Figure out this pages footer links. | 806 | -- Figure out this pages footer links. |
807 | local temp = '' | ||
807 | metadata.footer = '' | 808 | metadata.footer = '' |
808 | if nil ~= metadata.pagehistory then metadata.history = '<p>Page <a href="' .. metadata.pagehistory .. '/' .. name .. '.md">history</a></p>' else metadata.history = '' end | 809 | if nil == metadata.pagehistory then |
810 | if 'Foswiki' == metadata.ogWiki then metadata.pagehistory = metadata.ogURL .. '/bin/oops/' .. metadata.ogBase .. '/' .. metadata.ogFile .. '?template=oopshistory' end | ||
811 | if 'PmWiki' == metadata.ogWiki then metadata.pagehistory = metadata.ogURL .. '/?n=' .. metadata.ogBase .. '.' .. metadata.ogFile .. '?action=diff' end | ||
812 | else | ||
813 | temp = '/' .. name .. '.md' | ||
814 | end | ||
815 | if nil ~= metadata.pagehistory then metadata.history = '<p>Page <a href="' .. metadata.pagehistory .. temp .. '">history</a></p>' else | ||
816 | metadata.history = '' | ||
817 | end | ||
809 | if nil ~= metadata.sourcecode then metadata.footer = '<a href="' .. metadata.sourcecode .. '">source code</a>' end | 818 | if nil ~= metadata.sourcecode then metadata.footer = '<a href="' .. metadata.sourcecode .. '">source code</a>' end |
810 | if nil ~= metadata.feedatom then metadata.footer = '<a href="' .. metadata.feedatom .. '">atom feed</a> ' .. metadata.footer end | 819 | if nil ~= metadata.feedatom then metadata.footer = '<a href="' .. metadata.feedatom .. '">atom feed</a> ' .. metadata.footer end |
811 | if metadata.footer ~= '' then metadata.footer = 'Web site ' .. metadata.footer end | 820 | if metadata.footer ~= '' then metadata.footer = 'Web site ' .. metadata.footer end |
@@ -814,10 +823,10 @@ for name, file in pairs(Files) do | |||
814 | local title, link = whichWiki(metadata) | 823 | local title, link = whichWiki(metadata) |
815 | link = string.gsub(link, 'https://', 'HTTPS://') -- Prevent this one from being converted. | 824 | link = string.gsub(link, 'https://', 'HTTPS://') -- Prevent this one from being converted. |
816 | -- 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? | 825 | -- 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? |
817 | local edit = 'edit' | 826 | local edit = 'T' |
818 | if 'PmWiki' == metadata.ogWiki then edit = '<a href="' .. link .. '?action=edit">edit</a>' end | 827 | if 'PmWiki' == metadata.ogWiki then edit = 'Maybe you can <a href="' .. link .. '?action=edit">edit</a> t' end |
819 | -- if 'Foswiki' == metadata.ogWiki then edit = 'edit' end | 828 | -- if 'Foswiki' == metadata.ogWiki then edit = '' end |
820 | metadata.footer = '<a href="' .. link .. '">Original page</a>, maybe you can ' .. edit .. ' it. ' .. metadata.footer | 829 | metadata.footer = edit .. 'he <a href="' .. link .. '">original page</a>. ' .. metadata.footer |
821 | end | 830 | end |
822 | metadata.footer = '<p>' .. metadata.footer .. '</p>' | 831 | metadata.footer = '<p>' .. metadata.footer .. '</p>' |
823 | 832 | ||