From 0a937d32c1d51c2f87043b9f7b787d0079809c12 Mon Sep 17 00:00:00 2001 From: dvs1 Date: Thu, 27 Mar 2025 10:47:28 +1000 Subject: Keep old .md.md files around. --- notYetAnotherWiki.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'notYetAnotherWiki.lua') diff --git a/notYetAnotherWiki.lua b/notYetAnotherWiki.lua index 0883d87..5033d78 100755 --- a/notYetAnotherWiki.lua +++ b/notYetAnotherWiki.lua @@ -267,7 +267,9 @@ for l in io.popen('find -L ' .. Folder .. ' -name unsorted -prune -o -name "*.md local a, e = io.open(unsort .. tp .. '.md' , 'r') if nil ~= a then a:close() - os.execute('rm ' .. unsort .. tp .. '.*') + -- Keep the .md.md symlink, delete the rest. + os.execute('rm ' .. unsort .. tp .. '.HTML') + os.execute('rm ' .. unsort .. tp .. '.md') end end end @@ -868,7 +870,15 @@ for name, file in pairs(Files) do end else if nil ~= url then metadata.menu = metadata.menu .. '

' .. title .. ' ☝

' - else metadata.menu = metadata.menu .. '

' .. title .. '

' + else + local pth = file.path + if '' ~= pth then pth = pth .. '/' end + -- Don't include any left over .md.md files, so don't do this if f.md doesn't exist. + local a, e = io.open(pth .. f .. '.md' , 'r') + if nil ~= a then + a:close() + metadata.menu = metadata.menu .. '

' .. title .. '

' + end end end end -- cgit v1.1