ferron

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

commit 689121eb69729d2a6c335000acde2cb44acc31fa
parent edca1bbd23fb5e8f0b2549d856b376f254375371
Author: Hugo Soucy <hugo.soucy@savoirfairelinux.com>
Date:   Thu, 23 Nov 2017 17:02:07 -0500

Make some tests.

Diffstat:
Mfunctions/make-non-textuals-exports.lua | 16++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/functions/make-non-textuals-exports.lua b/functions/make-non-textuals-exports.lua @@ -5,30 +5,30 @@ local path = require("path") local tableutils = require("functions.table-utils") local function makenontextualsexports() - local mimestable = {"image/svg+xml", "image/jpeg", "image/png"} + local mimestable = {"image/svg+xml", "image/jpeg", "image/png"} path.each( Ferron.site.path .. Ferron.site.config.SITE.PATHS.CONTENT .. "/*", "f", - function(f) + function(f) if tableutils.hasvalue(mimestable, mimetypes.guess(f)) then local img = f local img_relpath = path.dirname(img):sub((Ferron.site.path .. Ferron.site.config.SITE.PATHS.CONTENT .. "/"):len() + 1) local img_section = img_relpath:match("^(.-)/") - --if path.extension(f) == ".jpg" or path.extension(f) == ".png" then - --print("." .. img:sub((Ferron.site.path .. Ferron.site.config.SITE.PATHS.CONTENT .. "/" .. path.dirname(img)):len() + 1)) - print(img_section) + --if path.extension(f) == ".jpg" or path.extension(f) == ".png" then + --print("." .. img:sub((Ferron.site.path .. Ferron.site.config.SITE.PATHS.CONTENT .. "/" .. path.dirname(img)):len() + 1)) + print(img_section) end end, {recurse = true} ) - + -- Create symlinks for images in section's landing page -- @TODO Create a table with all mime/type accpeted instead of a list of extensions -- path.each( -- path.dirname(file) .. "/*", "f", - -- function(f) + -- function(f) -- if path.extension(f) == ".jpg" or path.extension(f) == ".png" then -- print(mimetypes.guess(f)) - -- -- lfs.link("." .. f:sub((Ferron.site.path .. Ferron.site.config.SITE.PATHS.CONTENT .. "/" .. filesection):len() + 1), path.dirname(file) .. "/" .. f:match("^.+/(.+)$"), true) + -- -- lfs.link("." .. f:sub((Ferron.site.path .. Ferron.site.config.SITE.PATHS.CONTENT .. "/" .. filesection):len() + 1), path.dirname(file) .. "/" .. f:match("^.+/(.+)$"), true) -- print(f) -- end -- end,