@@ -441,7 +441,7 @@ local function setup()
441441 -- Lua libraries.
442442 json = jsonLib,
443443 lfs = lfs,
444- utf8 = utf8, -- @Doc
444+ utf8 = utf8,
445445 xml = xmlLib,
446446
447447 toml = { -- @Cleanup: Don't use 3rd party TOML library.
@@ -472,11 +472,11 @@ local function setup()
472472 generatorMeta = generatorMeta,
473473 getFilename = getFilename,
474474 getKeys = getKeys,
475- gmatchAndBetween = gmatchAndBetween, -- @Doc
475+ gmatchAndBetween = gmatchAndBetween,
476476 indexOf = indexOf,
477477 ipairsr = ipairsr,
478478 isAny = isAny,
479- isValueHtml = doesValueLookLikeHtml, -- @Doc
479+ isValueHtml = doesValueLookLikeHtml,
480480 markdown = markdownToHtml,
481481 max = math.max,
482482 min = math.min,
@@ -535,22 +535,22 @@ local function setup()
535535 return (getBasename_internal(getFilename(genericPath)))
536536 end,
537537
538- X = function(node, tagName) -- @Doc
538+ X = function(node, tagName) -- @Cleanup: Remove this!
539539 if type(node) ~= "table" then error("Invalid XML argument.", 2) end
540540 return (itemWith(node, "tag", tagName))
541541 end,
542542
543- Xs = function(node, tagName) -- @Doc
543+ Xs = function(node, tagName) -- @Cleanup: Remove this!
544544 if type(node) ~= "table" then error("Invalid XML argument.", 2) end
545545 return (itemWithAll(node, "tag", tagName))
546546 end,
547547
548- forXml = function(node, tagName) -- @Doc
548+ forXml = function(node, tagName) -- @Cleanup: Remove this!
549549 if type(node) ~= "table" then error("Invalid XML argument.", 2) end
550550 return ipairs(itemWithAll(node, "tag", tagName))
551551 end,
552552
553- printXmlTree = function(node) -- @Doc
553+ printXmlTree = function(node) -- @Cleanup: Remove this!
554554 if type(node) ~= "table" then error("Invalid XML argument.", 2) end
555555
556556 local function printNode(node, indent)
@@ -781,7 +781,7 @@ local function setup()
781781 return fileInfos
782782 end,
783783
784- getGeneratedPages = function() -- @Doc
784+ getGeneratedPages = function()
785785 -- Just like getOutputtedFiles(), there's no reason to restrict context for this function, I don't think. 2021-05-18
786786 local generatedPages = {}
787787
@@ -818,7 +818,6 @@ local function setup()
818818 return _dataParsers
819819 end,
820820
821- -- array = clampArray( array, length ) -- @Doc
822821 clampArray = function(t, len)
823822 for i = #t, len+1, -1 do
824823 t[i] = nil
@@ -827,7 +826,7 @@ local function setup()
827826 end,
828827
829828 --
830- -- html = summarize( html, maxCharacters [, keepSomeElements=false ] ) -- @Doc
829+ -- html = summarize( html, maxCharacters [, keepSomeElements=false ] )
831830 --
832831 -- Limit the amount of text and restrict allowed tags in an HTML string
833832 -- to be used e.g. as the description for an item in an RSS feed.
@@ -1041,7 +1040,7 @@ local function setup()
10411040 table.insert(getContext"template".out, tostringForTemplates(s))
10421041 end,
10431042
1044- echoSmart = function(v) -- @Doc
1043+ echoSmart = function(v)
10451044 assertContext("template", "echoSmart")
10461045 if v == nil then
10471046 -- void Echo nothing.
@@ -1543,8 +1542,9 @@ local function buildWebsite()
15431542 -- Template.
15441543 elseif site._fileTypes[extLower] then
15451544 -- Generate these later so e.g. urlExists() works better.
1546- local pagesArray = ((site._fileTypes[extLower] == "markdown" or site._fileTypes[extLower] == "html") and site._pages or nonPagePages)
1547- table.insert(pagesArray, newPage(pathRel, false))
1545+ local page = newPage(pathRel, false)
1546+ local pagesArray = (page.isPage and site._pages or nonPagePages)
1547+ table.insert(pagesArray, page)
15481548
15491549 -- Special.
15501550 elseif pathRel == ".htaccess" and handleHtaccess then
@@ -1572,7 +1572,7 @@ local function buildWebsite()
15721572 end)
15731573
15741574 for _, page in ipairs(nonPagePages) do
1575- generateFromTemplateFile(page)
1575+ generateFromTemplateFile(page) -- Note that this template may trigger generation of actual pages (e.g. by calling subpages()).
15761576 end
15771577
15781578 for _, page in ipairs(site._pages) do
0 commit comments