BREAKING CHANGES(sitecontents and title): pageContent and pageTitle shortcodes
This commit is contained in:
@@ -260,22 +260,13 @@ for index, _ in ipairs(markdownFiles) do
|
|||||||
end
|
end
|
||||||
markdownFiles[index].content = styling(markdownFiles[index].content)
|
markdownFiles[index].content = styling(markdownFiles[index].content)
|
||||||
|
|
||||||
-- replace <!-- sitecontents --> with markdown file content
|
-- start_idx, end_idx = c
|
||||||
local start_idx, end_idx = content:find("<!-- sitecontents -->", 1, true)
|
-- {{pageContent}} shortcode
|
||||||
if start_idx and end_idx then
|
content = content:gsub("{{pageContent}}", markdownFiles[index].content)
|
||||||
local first = content:sub(1, start_idx - 1)
|
-- {{pageTitle}} shortcode
|
||||||
local second = content:sub(end_idx + 1)
|
content = content:gsub("{{pageTitle}}", markdownFiles[index].options["title"])
|
||||||
content = first .. markdownFiles[index].content .. second
|
|
||||||
end
|
|
||||||
while content:find("<!-- title -->", 1, true) do
|
|
||||||
start_idx, end_idx = content:find("<!-- title -->", 1, true)
|
|
||||||
if start_idx and end_idx then
|
|
||||||
local first = content:sub(1, start_idx - 1)
|
|
||||||
local second = content:sub(end_idx + 1)
|
|
||||||
content = first .. markdownFiles[index].options["title"] .. second
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
local start_idx, end_idx
|
||||||
-- list shortcodes
|
-- list shortcodes
|
||||||
while content:find("{{list:}}", 1, true) do
|
while content:find("{{list:}}", 1, true) do
|
||||||
start_idx, end_idx = content:find("{{list:}}")
|
start_idx, end_idx = content:find("{{list:}}")
|
||||||
|
|||||||
Reference in New Issue
Block a user