From 655cd79991ec9204afb9f5acf52495c13af14d25 Mon Sep 17 00:00:00 2001 From: sanine Date: Thu, 12 Jan 2023 17:24:25 -0600 Subject: begin go refactor --- layouts/base.lua | 63 -------------------------------------------------------- layouts/blog.lua | 8 ------- 2 files changed, 71 deletions(-) delete mode 100644 layouts/base.lua delete mode 100644 layouts/blog.lua (limited to 'layouts') diff --git a/layouts/base.lua b/layouts/base.lua deleted file mode 100644 index 1c585d7..0000000 --- a/layouts/base.lua +++ /dev/null @@ -1,63 +0,0 @@ -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, - '

(.-)

', - function(s) - return string.format( - '

%s

%s
', - s, string.rep('=', string.len(s)) - ) - end - ) - - html = string.gsub( - html, - '

(.-)

', - function(s) - return string.format( - '

%s

%s
', - s, string.rep('-', string.len(s)) - ) - end - ) - - local fmt = [[ - - - - - - %s - - - -
- %s - %s -
- - -]] -return string.format( - fmt, - string.format('%s | %s', page_tbl.title, argent.config.site_name), - navigation, - html) -end diff --git a/layouts/blog.lua b/layouts/blog.lua deleted file mode 100644 index eaed8a2..0000000 --- a/layouts/blog.lua +++ /dev/null @@ -1,8 +0,0 @@ -local base = require('layouts.base') - -return function(html, page_tbl) - local html = string.format( - '

%s

\n\n%s', - page_tbl.title, html) - return base(html, page_tbl) -end -- cgit v1.2.1