satelito

Static [web] site (or page) generator (ssg) made with Lua script.
git clone git://soucy.cc/satelito.git
Log | Files | Refs | README

commit c6ad905027dab564d9fd4f31130bb8ed3d8641a8
parent 66f7a335e8a39a1f20954c3dd70f7aec3aa95046
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Tue, 30 Mar 2021 08:46:47 -0400

Use filemeta instead of config

Diffstat:
Msatelito/feed.lua | 11+++++------
1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/satelito/feed.lua b/satelito/feed.lua @@ -8,17 +8,16 @@ local model = require 'satelito.model' local site = require 'satelito.site' local template = require 'satelito.template' -function feed.build(filepath) - local config = assert(site.set_config(filepath), "Sorry, the site configuration can't be set") - local relpath = assert(file.get_relpath(filepath, site.get_root(filepath) .. '/' .. config.paths.content)) - local feed_parameters = assert(model.get(filepath)) +function feed.build(filepath, filemeta) + local feed_meta = filemeta + local relpath = assert(file.get_relpath(filepath, site.get_root(filepath) .. '/' .. feed_meta.paths.content)) local feed_entries = { children = assert(file.is_index(filepath) and list.build(filepath) or {}) } local feed_template = assert(template.set_feed(filepath)) - local feed_xml = feed_template(lume.extend({}, feed_parameters, feed_entries)) + local feed_xml = feed_template(lume.extend({}, feed_meta, feed_entries)) local feed_xml_path = assert( site.get_root(filepath) .. '/' - .. config.paths.public_html + .. feed_meta.paths.public_html .. relpath:match('(.+)%..*') .. '.xml' )