commit 0a7f517c9fc2e732d1c9d1507e0e17ce73c98de2
parent 5901949a7f5c8296a83a81209ce714bd49827b12
Author: Hugo Soucy <hugo@soucy.cc>
Date: Wed, 6 Feb 2019 08:37:58 -0500
Change the assignment of the Ferron global table.
Diffstat:
M | ferron/init.lua | | | 69 | +++++++++++++++++++++++++-------------------------------------------- |
1 file changed, 25 insertions(+), 44 deletions(-)
diff --git a/ferron/init.lua b/ferron/init.lua
@@ -4,6 +4,7 @@
-- Required Modules
inspect = require "inspect"
+
local lfs = require "lfs"
local config = require "ferron.config"
local site = require "ferron.site"
@@ -17,30 +18,30 @@ local app = require "ferron.app"
-- App's Globals
-- Init the main namespace
-Ferron = {}
--- Set if the build need to be in devmode
-Ferron.devmode = (arg[1] == "--dev" and true or false)
--- Chosen site to build must be global
-Ferron.site = {
- location = lfs.currentdir() .. "/" .. config.sites,
- config = nil,
- path = nil,
- pagestable = {},
- navigation = {},
-}
-
-Ferron.init = {
- site.setsite,
- site.sitereset,
- site.setnavigation,
-}
-
-Ferron.build = {
- page.init,
- list.init,
- link.makeshorts,
- link.makerewritemap,
- static.init,
+Ferron = {
+ devmode = (arg[1] == "--dev" and true or false),
+
+ site = {
+ location = lfs.currentdir() .. "/" .. config.sites,
+ config = nil,
+ path = nil,
+ pagestable = {},
+ navigation = {},
+ },
+
+ init = {
+ site.setsite,
+ site.sitereset,
+ site.setnavigation,
+ },
+
+ build = {
+ page.init,
+ list.init,
+ link.makeshorts,
+ link.makerewritemap,
+ static.init,
+ },
}
if arg[1] == "--set" and arg[2] == "content" then
@@ -56,23 +57,3 @@ if arg[1] == "--run" and type(arg[2]) == "string" and arg[2] ~= "" then
end
return app.exec(Ferron.init, Ferron.build)
-
---[[
- @TODO API
-
- - App
- -- Execution
- -- Installing
-
- - Site
- -- Information
- -- Listing
- -- Selection
- -- Creation
- -- Reseting
- -- Building
-
- - Content (markdown)
- -- Creation
- -- Listing
-]]--