ferron

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

commit 93cc81b7f347a41e5beda8a8d8e28e3099fc7082
parent 62cb4bfe763e2c4da8582275f034cccd6fbfeb23
Author: Hugo Soucy <hsoucy@kronostechnologies.com>
Date:   Tue, 18 Dec 2018 13:21:54 -0500

Add a new way to get paths strings

Diffstat:
Mferron/site.lua | 25++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)

diff --git a/ferron/site.lua b/ferron/site.lua @@ -4,9 +4,18 @@ local config = require "ferron.config" local tableutils = require "ferron.utilities.table-utils" local fileutils = require "ferron.utilities.file-utils" -local site = { site = nil } - -site.location = lfs.currentdir() .. "/" .. config.sites +local site = { + location = lfs.currentdir() .. "/" .. config.sites, + paths = { + archetypes = nil , + content = nil, + data = nil, + html = nil, + plugins = nil, + static = nil, + templates = nil, + } +} function site.listsites() -- Create a simple array with the directory name of the sites @@ -59,7 +68,13 @@ function site.setsite(name) Ferron.site = site.getsiteinfos((name ~= nil and name or sites_list[tonumber(whichsite)])) Ferron.site.config.baseurl = (Ferron.devmode == true and Ferron.site.config.urldev or Ferron.site.config.url) - site.site = Ferron.site + site.paths.archetypes = Ferron.site.path .. Ferron.site.config.paths.archetypes + site.paths.content = Ferron.site.path .. Ferron.site.config.paths.content + site.paths.data = Ferron.site.path .. Ferron.site.config.paths.data + site.paths.html = Ferron.site.path .. Ferron.site.config.paths.html + site.paths.plugins = Ferron.site.path .. Ferron.site.config.paths.plugins + site.paths.static = Ferron.site.path .. Ferron.site.config.paths.static + site.paths.templates = Ferron.site.path .. Ferron.site.config.paths.templates return Ferron.site end @@ -91,7 +106,7 @@ end -- Reset the `public_html/` folder of the selected site function site.reset() - local publichtml = Ferron.site.path .. Ferron.site.config.paths.html + local publichtml = site.paths.html local function removefiles(dir) local ok, errormsg -- remove files from directory