ferron

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

commit a91d48475805be3e470c18a570b112ca683ecb32
parent c9c890278cb9748d52dfe2e1c2fcc4cbeabdd135
Author: Hugo Soucy <hugo.soucy@toumoro.com>
Date:   Mon, 10 Feb 2020 21:31:42 -0500

Make some tests

Diffstat:
Mferron/link.lua | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ferron/link.lua b/ferron/link.lua @@ -50,10 +50,10 @@ end function link.makerewritemap() local links_db = site.data .. '/shortlinks.json' - local links_map = site.html .. '/shortlinksmap.txt' + local links_map = site.html .. '/shortlinksmap' if fl.isFile(links_db) then - links = json.decode(fl.pullfilecontent(links_db)) + local links = json.decode(fl.pullfilecontent(links_db)) if links then -- Create an empty map file @@ -64,8 +64,8 @@ function link.makerewritemap() for k, v in pairs(links) do -- location "/C" { block return 301 "https://$SERVER_NAME/C" } - map:write(v .. ' ' .. k, '\n') - -- map:write('location match ' .. '"/' .. tostring(v) .. '" { block return 301 "https://$SERVER_NAME' .. tostring(k), '"}\n') + -- map:write(v .. ' ' .. k, '\n') + map:write('location match ' .. '"^/' .. tostring(v) .. '$" { block return 301 "https://$SERVER_NAME' .. tostring(k), '"}\n') end -- Close it when it's done