summaryrefslogtreecommitdiff
path: root/layouts/base.lua
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2023-01-12 17:24:25 -0600
committersanine <sanine.not@pm.me>2023-01-12 17:24:25 -0600
commit655cd79991ec9204afb9f5acf52495c13af14d25 (patch)
treec2f441e09ce65337bb622183107a77c40c0dad0b /layouts/base.lua
parent35de9c18b9c9ce7d466e5aecec0b4becde2795bb (diff)
begin go refactorgo-dynamic
Diffstat (limited to 'layouts/base.lua')
-rw-r--r--layouts/base.lua63
1 files changed, 0 insertions, 63 deletions
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('<a href="%s">%s</a> ', link[2], link[1])
-end
-navlinks = string.sub(navlinks, 1, -4)
-
-local navigation = string.format('<div id="navigation"><pre>%s</pre></div>', navlinks)
-
-return function(html, page_tbl)
- local html = string.gsub(
- html,
- '<h1>(.-)</h1>',
- function(s)
- return string.format(
- '<h1>%s</h1>%s</br>',
- s, string.rep('=', string.len(s))
- )
- end
- )
-
- html = string.gsub(
- html,
- '<h2>(.-)</h2>',
- function(s)
- return string.format(
- '<h2>%s</h2>%s</br>',
- s, string.rep('-', string.len(s))
- )
- end
- )
-
- local fmt = [[
-<!doctype html>
- <html>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="icon" type="image/svg+xml" href="/favicon.svg">
- <title>%s</title>
- <link rel="stylesheet" href="/style.css">
- </html>
- <body>
- <div id="content">
- %s
- %s
- </div>
- </body>
-</html>
-]]
-return string.format(
- fmt,
- string.format('%s | %s', page_tbl.title, argent.config.site_name),
- navigation,
- html)
-end