ferron

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

commit f2888389d1e26703f596cfbb9c485f3409f4a0b3
parent 5e6560e1ff0cec2b8e7847f2cb2127a74c9f6a32
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Fri, 24 Nov 2017 20:31:36 -0500

Remove makenontextualsexports

Diffstat:
Mferron.lua | 4+---
Dfunctions/make-non-textuals-exports.lua | 39---------------------------------------
2 files changed, 1 insertion(+), 42 deletions(-)

diff --git a/ferron.lua b/ferron.lua @@ -18,7 +18,6 @@ local createarchetypecontent = require("functions.create-archetype-content") local makepages = require("functions.make-pages") local makelistsofpages = require("functions.make-lists-of-pages") local makeatomfeed = require("functions.make-atom-feed") -local makenontextualsexports = require("functions.make-non-textuals-exports") local movetopublichtml = require("functions.move-to-publichtml") local exec = require("functions.exec") @@ -39,8 +38,7 @@ Ferron.initfunctions = { Ferron.buildfunctions = { makepages, makelistsofpages, - makeatomfeed, - makenontextualsexports, + makeatomfeed, movetopublichtml } diff --git a/functions/make-non-textuals-exports.lua b/functions/make-non-textuals-exports.lua @@ -1,39 +0,0 @@ --- -local lfs = require("lfs") -local mimetypes = require('mimetypes') -local path = require("path") -local tableutils = require("functions.table-utils") - -local function makenontextualsexports() - local mimestable = {"image/svg+xml", "image/jpeg", "image/png"} - - path.each( - Ferron.site.path .. Ferron.site.config.SITE.PATHS.CONTENT .. "/*", "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) - 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) - -- 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) - -- print(f) - -- end - -- end, - -- {recurse = true} - -- ) -end - -return makenontextualsexports