From a50be38fcc361a3a8b4c55dc4e0c9544bd770593 Mon Sep 17 00:00:00 2001 From: dvs1 Date: Fri, 17 Jan 2025 15:26:04 +1000 Subject: Fix the logo and icon inheritance. --- notYetAnotherWiki.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/notYetAnotherWiki.lua b/notYetAnotherWiki.lua index e6e26a7..839065c 100755 --- a/notYetAnotherWiki.lua +++ b/notYetAnotherWiki.lua @@ -206,15 +206,18 @@ for name, file in pairs(Files) do for n, y in ipairs{'favicon', 'logo'} do local pith = '' if nil ~= metadata[y] then - local pth = '' + local pth, found = '', false + + if (nil ~= Subs[''].metadata) and (nil ~= Subs[''].metadata[y]) then pith = '' ; found = true end + for m, x in ipairs(bits) do if '' ~= pth then pth = pth .. '/' end pth = pth .. x - if (nil ~= Subs[pth].metadata) and (nil ~= Subs[pth].metadata[y]) then pith = pth end + if (nil ~= Subs[pth].metadata) and (nil ~= Subs[pth].metadata[y]) then pith = pth ; found = true end end - if ('' == pith) and (nil ~= Subs[''].metadata) and (nil ~= Subs[''].metadata[y]) then pith = pth end - if '' == pith then metadata[y] = linkFrom(path, pith) .. globalData[y] - else metadata[y] = linkFrom(path, pith) .. metadata[y] +-- if ('' == pith) and (nil ~= Subs[''].metadata) and (nil ~= Subs[''].metadata[y]) then pith = pth end + if found then metadata[y] = linkFrom(path, pith) .. metadata[y] + else metadata[y] = linkFrom(path, pith) .. globalData[y] end end end -- cgit v1.1