#!/usr/bin/env lua local datetime = require"huh.datetime" local config = require"huh.config".load(arg[1]) local posts = require"huh.blog".posts(config) print[[]] local year = nil local previous = nil for _, page in pairs(posts) do local date = datetime.parse(page.published) if date and year ~= date.year then year = date.year previous = nil print(string.format("
%d", year)) end date = datetime.describe(date) if date == previous then date = "" else previous = date end print(string.format([[
%s%s]], date, page.filename, page.title)) end print"
"