ferron

Ferron is a fast and simple static website generator made with Lua.
Log | Files | Refs | Submodules | README | LICENSE

commit 298596c681ac786ce07e80d4bc134f6db38bd8fc
parent 7cdb4ecef8aeaa48ceb6727d47e9b978d3c4c0a1
Author: Hugo Soucy <hsoucy@kronostechnologies.com>
Date:   Wed,  4 Apr 2018 11:44:25 -0400

Change a little bit the slug function

Diffstat:
Mferron/content.lua | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ferron/content.lua b/ferron/content.lua @@ -37,7 +37,8 @@ function content.makecontent() archetype.title = arg[2] -- string.gsub(string.gsub(str,"[^ A-Za-z]",""),"[ ]+","-") better for the slug? - archetype.filename = string.lower(archetype.title:gsub('%p','-'):gsub('%s','-')) + -- archetype.filename = string.lower(archetype.title:gsub('%p','-'):gsub('%s','-')) + archetype.filename = (archetype.title:gsub("[%s_]+", "-"):gsub("[^%w%-]+", ""):gsub("-+", "-")):lower() archetype.date = os.date("%Y-%m-%d") archetype.datetime = os.date("%H:%M:%S") archetype.template = arg[1]