ferron

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

commit e9089ee425ffc47603fc40a595cada9686bc3354
parent a92f022125fc5be800b23b454d15a2ed80336857
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Wed, 31 Jan 2018 03:43:23 -0500

Create a lua table to create prefetch links for images

Diffstat:
Mfunctions/dispatch-nontextuals.lua | 2++
Mfunctions/set-site.lua | 1+
2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/functions/dispatch-nontextuals.lua b/functions/dispatch-nontextuals.lua @@ -22,6 +22,8 @@ local function dispatchnontextuals(file) -- Copy all non-textual contents (jpg, pdf, png, svg, etc.) to `public_html/` path.copy(img, htmlfolder .. img_relpath) + + Ferron.site.config.SITE.PREFETCHLIST[#Ferron.site.config.SITE.PREFETCHLIST + 1] = img_relpath end end, {recurse = true} diff --git a/functions/set-site.lua b/functions/set-site.lua @@ -20,6 +20,7 @@ local function setsite() Ferron.site = Ferron.sites[Ferron.sitesarray[tonumber(answer)]] Ferron.site.config.SITE.BASEURL = (Ferron.devmode == true and Ferron.site.config.SITE.URLDEV or Ferron.site.config.SITE.URL) + Ferron.site.config.SITE.PREFETCHLIST = {} return Ferron.site end