motyl

Opinionated blog-aware static site generator written in Ruby
Log | Files | Refs | README | LICENSE

commit c43a446732cfcdb4327f83ab4f3c322e1e3383f5
parent 0db15aaea542ba2b841b757f880af5ffddb94e3c
Author: Frederic Cambus <fred@statdns.com>
Date:   Mon, 24 Apr 2017 10:50:55 +0200

Do not overwrite data.page.url if it's set in pages or posts metadata

Diffstat:
Msrc/motyl.lua | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/motyl.lua b/src/motyl.lua @@ -93,7 +93,9 @@ local function render(directory) local path = file:match "(.*).md$" data.page = loadYAML(directory .. "/" .. path .. ".yaml") data.page.content = loadMD(directory .. "/" .. file) - data.page.url = path .. "/" + if data.page.url == nil then + data.page.url = path .. "/" + end status("Rendering " .. data.page.url) @@ -116,8 +118,8 @@ local function render(directory) end end - lfs.mkdir("deploy/" .. path) - writeFile("deploy/" .. path .. "/index.html", renderTemplate(templates[directory], data, templates)) + lfs.mkdir("deploy/" .. data.page.url) + writeFile("deploy/" .. data.page.url .. "index.html", renderTemplate(templates[directory], data, templates)) data.page = {} end