ferron

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

commit 4ec991cb302774c56ae29fcce2884c33b758b929
parent 0e122f00f581e5a4709af162dd4c8a9ee089a479
Author: Hugo Soucy <hsoucy@kronostechnologies.com>
Date:   Mon, 15 Oct 2018 13:13:57 -0400

Start the plugin system

Diffstat:
Mcornelius | 2++
Mferron.lua | 5+++++
Aferron/plugin.lua | 18++++++++++++++++++
3 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/cornelius b/cornelius @@ -25,6 +25,8 @@ elseif arg[1] == "create" then os.execute("lua -l ferron.setpaths ferron.lua --set content") elseif arg[1] == "start" then os.execute("lua -l ferron.setpaths ferron.lua --make site") +elseif arg[1] == "-p" and type(arg[2]) == "string" and arg[2] ~= "" then + os.execute("lua -l ferron.setpaths ferron.lua --run " .. arg[2]) else print("Hi, I'm Cornelius Ferron, the eminence of the great horn of the static site generator... or if you prefer, the CLI.") print("What Can I Do for You?") diff --git a/ferron.lua b/ferron.lua @@ -19,6 +19,7 @@ local page = require "ferron.page" local list = require "ferron.list" local link = require "ferron.link" local static = require "ferron.static" +local plugin = require "ferron.plugin" local exec = require "ferron.utilities.exec" Ferron.init = { @@ -42,4 +43,8 @@ if arg[1] == "--make" and arg[2] == "site" then return site.makesite() end +if arg[1] == "--run" and type(arg[2]) == "string" and arg[2] ~= "" then + return plugin.run(site.setsite(), arg[2]) +end + return exec(Ferron.init, Ferron.build) diff --git a/ferron/plugin.lua b/ferron/plugin.lua @@ -0,0 +1,18 @@ +--[[ + Plugin Module +]]-- + +-- Required Packages +inspect = require "inspect" + +-- Module Declaration +local plugin = {} + +function plugin.run(site, plugname) + print(inspect(site.path), plugname) + os.execute("pwd") + + os.execute("lua " .. site.path .. "/plugins/" .. plugname .. "/" .. plugname .. ".lua") +end + +return plugin