ferron

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

commit 8ccbe25a19de6b0cc62e37ffc7e698d1d37ce363
parent 55cf1d6ad097d0f2e9c61f1e0ff1aa53d0bbb69b
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Sun,  4 Feb 2018 10:25:58 -0500

Start the link.lua module.

Diffstat:
Mferron.lua | 2++
Aferron/link.lua | 20++++++++++++++++++++
Mferron/page.lua | 1+
3 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/ferron.lua b/ferron.lua @@ -18,6 +18,7 @@ local content = require "ferron.content" local page = require "ferron.page" local list = require "ferron.list" local feed = require "ferron.feed" +local link = require "ferron.link" local static = require "ferron.static" local exec = function(...) @@ -43,6 +44,7 @@ Ferron.build = { page.makepage, list.makelist, feed.makefeed, + link.makeshortlink, static.move } diff --git a/ferron/link.lua b/ferron/link.lua @@ -0,0 +1,20 @@ +-- +local path = require "path" +local fileutils = require "ferron.utilities.file-utils" +local tableutils = require "ferron.utilities.table-utils" +local templateutils = require "ferron.utilities.template-utils" +local link = {} + +function link.makeshortlink() + local links = {} + + for k, v in tableutils.sortdescendingpairs(Ferron.site.pagestable) do + table.insert(links, v) + + print(inspect(k.rellink)) + end + + print("==========") +end + +return link diff --git a/ferron/page.lua b/ferron/page.lua @@ -34,6 +34,7 @@ function page.makepage() page_conf_mt.content = markdown(fileutils.pullfilecontent(page)) page_conf_mt.permalink = Ferron.site.siteconfig.baseurl .. (page_plainname ~= "index" and page_relpath .. ".html" or "") + page_conf_mt.rellink = (page_plainname ~= "index" and page_relpath .. ".html" or "") page_conf_mt.section = nil page_conf_mt["site"] = Ferron.site.siteconfig