From 28a973991fd62507391f492647e6cced681c4856 Mon Sep 17 00:00:00 2001 From: murat Date: Thu, 18 Jun 2026 10:02:39 +0300 Subject: [PATCH] BREAKING CHANGES(sitecontents and title): pageContent and pageTitle shortcodes --- luago.lua | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/luago.lua b/luago.lua index f1c4176..362e971 100644 --- a/luago.lua +++ b/luago.lua @@ -260,22 +260,13 @@ for index, _ in ipairs(markdownFiles) do end markdownFiles[index].content = styling(markdownFiles[index].content) - -- replace with markdown file content - local start_idx, end_idx = content:find("", 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].content .. second - end - while content:find("", 1, true) do - start_idx, end_idx = content:find("", 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 + -- start_idx, end_idx = c + -- {{pageContent}} shortcode + content = content:gsub("{{pageContent}}", markdownFiles[index].content) + -- {{pageTitle}} shortcode + content = content:gsub("{{pageTitle}}", markdownFiles[index].options["title"]) + local start_idx, end_idx -- list shortcodes while content:find("{{list:}}", 1, true) do start_idx, end_idx = content:find("{{list:}}")