From 0ff62ea7886bdeff160682d3d5713c2c8a6dd4b1 Mon Sep 17 00:00:00 2001 From: sanine Date: Thu, 13 Jan 2022 17:41:02 -0600 Subject: initial commit --- layouts/base.lua | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 layouts/base.lua (limited to 'layouts/base.lua') diff --git a/layouts/base.lua b/layouts/base.lua new file mode 100644 index 0000000..aae2081 --- /dev/null +++ b/layouts/base.lua @@ -0,0 +1,45 @@ +local navigation_table = { + {'home', '/index.html'}, + {'projects', '/projects/'}, + {'git', '/git'}, + {'about', '/about.html'}, +} + +local navlinks = '' + +for _, link in pairs(navigation_table) do + navlinks = navlinks .. + string.format('%s ', link[2], link[1]) +end +navlinks = string.sub(navlinks, 1, -4) + +local navigation = string.format('', navlinks) + +return function(html, page_tbl) + local html = string.gsub( + html, + '

(.-)

', + '

%1
================================

' + ) + + local fmt = [[ + + + + %s + + + + %s +
+ %s +
+ + +]] +return string.format( + fmt, + string.format('%s | %s', page_tbl.title, argent.config.site_name), + navigation, + html) +end -- cgit v1.2.1