satelito

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

feed.lua (490B)


      1 -- @module feed
      2 local feed = {}
      3 --
      4 local etlua = require 'etlua'
      5 local lume = require 'satelito.lib.lume.lume'
      6 local file = require 'satelito.file'
      7 local template = require 'satelito.template'
      8 
      9 function feed.make(filemeta, templates)
     10   local _feed = etlua.compile(file.read(template.find(templates, filemeta.feed)))
     11   local feed_xml = _feed(lume.extend({}, filemeta))
     12   local feed_xml_path = filemeta.exportlink:match('(.+)%..*')..'.xml'
     13 
     14   return feed_xml, feed_xml_path
     15 end
     16 
     17 
     18 return feed