Mercurial Hosting > disearch
changeset 1:d19b150ecb83
add Shared
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 19 Oct 2023 23:14:21 -0600 |
parents | 24d8dc525146 |
children | 5ae5fbce0d75 |
files | src/index.html.luan src/lib/Shared.luan src/site.css |
diffstat | 3 files changed, 78 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
diff -r 24d8dc525146 -r d19b150ecb83 src/index.html.luan --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/index.html.luan Thu Oct 19 23:14:21 2023 -0600 @@ -0,0 +1,27 @@ +local Luan = require "luan:Luan.luan" +local error = Luan.error +local Io = require "luan:Io.luan" +local Http = require "luan:http/Http.luan" +local Shared = require "site:/lib/Shared.luan" +local head = Shared.head or error() +local header = Shared.header or error() +local footer = Shared.footer or error() + + +return function() + Io.stdout = Http.response.text_writer() +%> +<!doctype html> +<html> + <head> +<% head() %> + <title>Disearch</title> + </head> + <body> +<% header() %> + <p>under construction</p> +<% footer() %> + </body> +</html> +<% +end
diff -r 24d8dc525146 -r d19b150ecb83 src/lib/Shared.luan --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/lib/Shared.luan Thu Oct 19 23:14:21 2023 -0600 @@ -0,0 +1,37 @@ +local Luan = require "luan:Luan.luan" +local error = Luan.error +local Time = require "luan:Time.luan" + + +local Shared = {} + +local started = Time.now() + +function Shared.head() +%> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <style> + @import "/site.css?s=<%=started%>"; + </style> +<% +end + +function Shared.header() +%> + <div header> + something or other in the header + </div> + <hr> +<% +end + +function Shared.footer() +%> + <hr> + <div footer> + something or other in the footer + </div> +<% +end + +return Shared
diff -r 24d8dc525146 -r d19b150ecb83 src/site.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/site.css Thu Oct 19 23:14:21 2023 -0600 @@ -0,0 +1,14 @@ +* { + box-sizing: border-box; +} + +body { + font-family: Sans-Serif; +} + +a { + text-decoration: none; +} +a:hover { + text-decoration: underline; +}