ferron

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

commit 9b0c4da8d77819276f6135a564fd80b42e484e8d
parent a2871109a39ec889779298373355971125bbe793
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Mon, 27 Nov 2017 08:15:59 -0500

Create a prefetch list.

Diffstat:
Mferron.lua | 2+-
Mfunctions/dispatch-nontextuals.lua | 12+++++++++---
Mfunctions/make-lists-of-pages.lua | 2++
Mrhino | 4+++-
4 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/ferron.lua b/ferron.lua @@ -19,7 +19,7 @@ local makeatomfeed = require("functions.make-atom-feed") local movetopublichtml = require("functions.move-to-publichtml") local exec = require("functions.exec") ---inspect = require("inspect") +inspect = require("inspect") Ferron.config = config Ferron.sites = {} diff --git a/functions/dispatch-nontextuals.lua b/functions/dispatch-nontextuals.lua @@ -7,7 +7,7 @@ local tableutils = require("functions.table-utils") local function dispatchnontextuals(file, filesection) local mimestable = {"image/svg+xml", "image/jpeg", "image/png", "application/pdf"} local prefetchtable = {} - + path.each( path.dirname(file) .. "/*", "f", function(f) @@ -22,11 +22,17 @@ local function dispatchnontextuals(file, filesection) path.copy(img, htmlfolder .. "/" .. img_section .. img_relpath) -- Then symlinks from those non-textuals for list index pages - lfs.link("." .. img_relpath, htmlfolder .. "/" .. img_section .. "/" .. img_name, true) + lfs.link("." .. img_relpath, htmlfolder .. "/" .. img_section .. "/" .. img_name, true) + + prefetchtable[#prefetchtable + 1] = Ferron.site.config.SITE.BASEURL .. "/" .. img_section .. img_relpath + + --print(Ferron.site.config.SITE.BASEURL .. "/" .. img_section .. img_relpath) end end, {recurse = true} - ) + ) + + return prefetchtable end return dispatchnontextuals diff --git a/functions/make-lists-of-pages.lua b/functions/make-lists-of-pages.lua @@ -46,6 +46,8 @@ local function makelistsofpages() dispatchnontextuals(listindex, listindex_section) + print(inspect(prefetchtable)) + -- Build the HTML file fileutils.pushfilecontent( listindex_html, diff --git a/rhino b/rhino @@ -1,3 +1,5 @@ -#!/usr/bin/env lua53 +#!/usr/bin/env lua -- Rhino is the futur CLI of Ferron SSG. + +print("test")