diff options
| author | dvs1 | 2025-01-14 11:46:11 +1000 |
|---|---|---|
| committer | dvs1 | 2025-01-14 11:46:11 +1000 |
| commit | 3818411cb54b78cfeb6259c6df5fec8a6d1f9a0f (patch) | |
| tree | acad82309b821eea1097beb4c0d22349c0f1ddf7 | |
| parent | Don't lowercase the resulting filename. (diff) | |
| download | notYetAnotherWiki-3818411cb54b78cfeb6259c6df5fec8a6d1f9a0f.zip notYetAnotherWiki-3818411cb54b78cfeb6259c6df5fec8a6d1f9a0f.tar.gz notYetAnotherWiki-3818411cb54b78cfeb6259c6df5fec8a6d1f9a0f.tar.bz2 notYetAnotherWiki-3818411cb54b78cfeb6259c6df5fec8a6d1f9a0f.tar.xz | |
Fix up whichPage() so they ALL have .HTML.
| -rwxr-xr-x | notYetAnotherWiki.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/notYetAnotherWiki.lua b/notYetAnotherWiki.lua index 4fd9fa1..0329852 100755 --- a/notYetAnotherWiki.lua +++ b/notYetAnotherWiki.lua | |||
| @@ -108,16 +108,16 @@ end | |||
| 108 | -- These functions assume the above file and sub scan has completed. | 108 | -- These functions assume the above file and sub scan has completed. |
| 109 | 109 | ||
| 110 | -- Which page in this directory should we show? | 110 | -- Which page in this directory should we show? |
| 111 | -- NOTE - only looking for the .md files we scanned for before, any stray HTML, html, HTM, atd htm files will get ignored. | 111 | -- NOTE - only looking for the .md files we scanned for before, any stray HTML, html, HTM, and htm files will get ignored. |
| 112 | local whichPage = function(f) | 112 | local whichPage = function(f) |
| 113 | local fl = '' | 113 | local fl = '' |
| 114 | if (nil ~= Subs[f]) and (nil ~= Subs[f].files) then | 114 | if (nil ~= Subs[f]) and (nil ~= Subs[f].files) then |
| 115 | if 1 == #(Subs[f].files) then fl = Subs[f].files[1] .. '.HTML' else | 115 | if 1 == #(Subs[f].files) then fl = Subs[f].files[1] else |
| 116 | -- Standard files to search for. | 116 | -- Standard files to search for. |
| 117 | for i, v in ipairs{'about', 'readme', 'index', 'homepage', 'mainpage', 'webhome'} do | 117 | for i, v in ipairs{'about', 'readme', 'index', 'homepage', 'mainpage', 'webhome'} do |
| 118 | for j, w in ipairs(Subs[f].files) do | 118 | for j, w in ipairs(Subs[f].files) do |
| 119 | if v == string.lower(w) then | 119 | if v == string.lower(w) then |
| 120 | fl = w .. '.HTML' | 120 | fl = w |
| 121 | break | 121 | break |
| 122 | end | 122 | end |
| 123 | end | 123 | end |
| @@ -127,6 +127,7 @@ local whichPage = function(f) | |||
| 127 | if ('' == fl) and (nil ~= Subs[f].files[1]) then fl = Subs[f].files[1] end | 127 | if ('' == fl) and (nil ~= Subs[f].files[1]) then fl = Subs[f].files[1] end |
| 128 | end | 128 | end |
| 129 | end | 129 | end |
| 130 | if '' ~= fl then fl = fl .. '.HTML' end | ||
| 130 | return fl | 131 | return fl |
| 131 | end | 132 | end |
| 132 | 133 | ||
