ferron

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

commit fc97b77859982ea07b1d3b0fde603bccf1665ff2
parent aca6cc3f8665365755ddec0ef85c73536b854a9f
Author: Hugo Soucy <hugo.soucy@savoirfairelinux.com>
Date:   Tue,  6 Feb 2018 14:37:49 -0500

Start the tag module.

Diffstat:
Mferron.lua | 2++
Mferron/link.lua | 6++----
Aferron/tag.lua | 21+++++++++++++++++++++
3 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/ferron.lua b/ferron.lua @@ -19,6 +19,7 @@ local page = require "ferron.page" local list = require "ferron.list" local feed = require "ferron.feed" local link = require "ferron.link" +local tag = require "ferron.tag" local static = require "ferron.static" local exec = function(...) @@ -46,6 +47,7 @@ Ferron.build = { feed.makefeed, link.makeshorts, link.makerewritemap, + tag.gettags, static.move } diff --git a/ferron/link.lua b/ferron/link.lua @@ -35,14 +35,12 @@ function link.makeshorts() fileutils.pushfilecontent(links_db, json.encode(links, {indent = true})) - print("========== DONE") - -- print(inspect(links), tableutils.length(links)) - --print(tableutils.length(links)) + print("==========") end function link.makerewritemap() local links_db = Ferron.site.path .. Ferron.site.siteconfig.paths.data .. "/shortlinks.json" - local links_map = Ferron.site.path .. Ferron.site.siteconfig.paths.html .. "/shortlinks.map.txt" + local links_map = Ferron.site.path .. Ferron.site.siteconfig.paths.html .. "/shortlinksmap.txt" if path.isfile(links_db) then links = json.decode(fileutils.pullfilecontent(links_db)) diff --git a/ferron/tag.lua b/ferron/tag.lua @@ -0,0 +1,21 @@ +-- +local json = require "dkjson" +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 tag = {} + +function tag.gettags() + local tags = {} + local pages = Ferron.site.pagestable + + for k, v in pairs(pages) do + if v.keywords ~= nil then + print(v.permalink, inspect(v.keywords)) + end + end + +end + +return tag