Skip to content

Commit f37c8c3

Browse files
committed
Fixed subpages() including pages in sibling folders whose name begins with the same name (e.g. /blog/index.md included pages under /blogosphere/*).
1 parent dadd331 commit f37c8c3

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/app.lua2p

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,13 @@ local function setup()
964964
local subpages = {}
965965

966966
for _, page in ipairs(site._pages) do
967-
if (page ~= pageCurrent or allowCurrentPage) and page._path:sub(1, #dir) == dir then
967+
if (page ~= pageCurrent or allowCurrentPage) and (
968+
dir == ""
969+
or (
970+
page._path:byte(#dir+1) == !(string.byte"/") and
971+
page._path:find(dir, 1, true) == 1
972+
)
973+
) then
968974
if not page._isGenerated then
969975
generateFromTemplateFile(page)
970976
end
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Nope, nothing here.

0 commit comments

Comments
 (0)