--require 'luarocks.require' require 'table' require 'os' require 'string' require 'cosmo' require 'lfs' require 'extattr' require 'blutils' require 'templates' local root_dir = '/usr/local/www/bluedino.net/www' local downloads_dir = root_dir .. '/downloads' local suppress_file = blutils.suppress_file local breadcrumbs = blutils.breadcrumbs local toc = blutils.toc local function list_item() local d = lfs.dir(downloads_dir) local f = '' while (f) do repeat f = d() until not f or suppress_file(f) if not f then break end local path = downloads_dir .. '/' .. tostring(f) local item = extattr.get(path, 'name') or f local description = extattr.get(path, 'description') or 'Description not available.' cosmo.yield { item = item, file = f, description = description } end end local content_template = [=[
$description