satelito

Static site generator made with Lua script.
git clone git://soucy.cc/satelito.git
Log | Files | Refs | README

sitemapxml.lua (492B)


      1 -- @module sitemapxml
      2 local sitemapxml = {}
      3 --
      4 local etlua = require 'etlua'
      5 local file = require 'satelito.file'
      6 local template = require 'satelito.template'
      7 
      8 function sitemapxml.make(sitedata, templates, destination)
      9   local _sitemapxml = etlua.compile(file.read(template.find(templates, 'sitemap.xml')))
     10   local sitemapxml_xml = _sitemapxml({sitemap = sitedata})
     11   local sitemapxml_xml_path = destination..'sitemap.xml'
     12 
     13   return sitemapxml_xml, sitemapxml_xml_path
     14 end
     15 
     16 return sitemapxml