ferron

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

commit cb5eda471c9c4b5e6abf71cb57f8ab1458b1874c
parent fe9dc305975800f3e69b340b1e7a3c3073cf36bb
Author: Hugo Soucy <hs0ucy@h50ucy.local>
Date:   Fri, 26 Apr 2019 22:03:06 -0400

Delete the tag module because it's unused

Diffstat:
Dferron/tag.lua | 67-------------------------------------------------------------------
1 file changed, 0 insertions(+), 67 deletions(-)

diff --git a/ferron/tag.lua b/ferron/tag.lua @@ -1,67 +0,0 @@ --- tag.lua -local tag = {} -local tagmeta = { - __call = function(self, key, vars) - print(key) - end -} - -local json = require 'dkjson' -local fileutils = require 'ferron.utilities.file-utils' -local tableutils = require 'ferron.utilities.table-utils' -local templateutils = require 'ferron.utilities.template-utils' - -local function maketagstable() - local tagstable = {} - local pages = Ferron.site.pagestable - - for k, page in pairs(pages) do - if page.keywords then - for i, keyword in ipairs(page.keywords) do - if tableutils.hasvalue(tagstable, keyword) == false then - tagstable[keyword] = {} - end - end - end - end - - for k, page in pairs(pages) do - if page.keywords then - for i, keyword in ipairs(page.keywords) do - if tagstable[keyword] then - table.insert(tagstable[keyword], page.rellink) - end - end - end - end - - return tagstable -end - -function tag.maketagpage() - local tagstable = maketagstable() - - for tag, urls in pairs(tagstable) do - local tag_tb = { - tagname = tag, - tagurls = urls - } - - if fileutils.isDirectory(Ferron.site.html .. '/tag') == false then - fileutils.mkdir(Ferron.site.html .. '/tag') - end - - -- Build the HTML file - fileutils.pushfilecontent( - Ferron.site.html .. '/tag/' .. tag .. '.html', - templateutils.rendermustache( - fileutils.pullfilecontent(Ferron.site.templates .. '/tag.mustache'), - Ferron.site.templates .. '/partials', - tag_tb - ) - ) - end - -end - -return setmetatable(tag)