Mercurial Hosting > lang
changeset 0:9845dcb9f5fc
start
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 08 Jul 2025 10:40:25 -0600 |
parents | |
children | 1c87f785eb42 |
files | .hgignore serve.sh src/index.html.luan src/lib/Shared.luan src/site.css |
diffstat | 5 files changed, 79 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgignore Tue Jul 08 10:40:25 2025 -0600 @@ -0,0 +1,3 @@ +syntax: glob + +err
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/serve.sh Tue Jul 08 10:40:25 2025 -0600 @@ -0,0 +1,3 @@ +#!/bin/bash + +luan luan:http/serve.luan src 2>&1 | tee err
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/index.html.luan Tue Jul 08 10:40:25 2025 -0600 @@ -0,0 +1,29 @@ +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() + + +return function() + Io.stdout = Http.response.text_writer() +%> +<!doctype html> +<html lang="en"> + <head> +<% head() %> + <title>Lang</title> + <style> + </style> + </head> + <body> +<% header() %> + <div content> + <h1>Lang</h1> + </div> + </body> +</html> +<% +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/lib/Shared.luan Tue Jul 08 10:40:25 2025 -0600 @@ -0,0 +1,23 @@ +local Luan = require "luan:Luan.luan" +local error = Luan.error + + +local Shared = {} + +function Shared.head() +%> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <style> + @import "/site.css"; + </style> +<% +end + +function Shared.header() +%> + <div header> + </div> +<% +end + +return Shared
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/site.css Tue Jul 08 10:40:25 2025 -0600 @@ -0,0 +1,21 @@ +* { + box-sizing: border-box; +} + +body { + font-family: Sans-Serif; + margin: 0; +} + +a { + text-decoration: none; +} +a:hover { + text-decoration: underline; +} + +[content] { + margin-left: 3%; + margin-right: 3%; + margin-bottom: 2em; +}