commit 8b505ec5e25aebad1db08d2cac8f5c773940311d
parent c3a79d9ff22b9853fdae55c7b3dc3112c14fe09d
Author: Hugo Soucy <hugo.soucy@savoirfairelinux.com>
Date: Fri, 2 Feb 2018 16:26:22 -0500
Remove `Ferron.config` and use config only in site module.
Diffstat:
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/ferron.lua b/ferron.lua
@@ -5,8 +5,10 @@
-- Init the Main Namespace
Ferron = {}
+Ferron.site = {}
+Ferron.devmode = (arg[1] == "--dev" and true or false)
+
-- Ferron's Modules
-local config = require "config"
local site = require "ferron.site"
local content = require "ferron.content"
local page = require "ferron.page"
@@ -26,10 +28,6 @@ local exec = function(...)
end
end
-Ferron.config = config
-Ferron.site = {}
-Ferron.devmode = (arg[1] == "--dev" and true or false)
-
if Ferron.devmode == true then
inspect = require "inspect"
end
diff --git a/ferron/site.lua b/ferron/site.lua
@@ -1,4 +1,5 @@
local path = require "path"
+local config = require "config"
local tableutils = require "ferron.utilities.table-utils"
local fileutils = require "ferron.utilities.file-utils"
@@ -8,8 +9,8 @@ local sites_tb = {}
local sites_list = {}
function site.getsites()
- -- Create a table with the content of `Ferron.config.paths.sites`
- for s in path.each(Ferron.config.paths.sites .. "/*", "f", {delay = true; reverse = true;}) do
+ -- Create a table with the content of `config.paths.sites`
+ for s in path.each(config.paths.sites .. "/*", "f", {delay = true; reverse = true;}) do
if path.isdir(s) then
-- Load site configuration
local s_config, s_config_err = fileutils.loadlocalconfig(s .. "/site-config.lua")