Mercurial Hosting > freedit
changeset 1:7c64173643c8
start config
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 15 Jun 2022 20:59:13 -0600 |
parents | 6a1e2749571d |
children | fc2383eb48a9 |
files | src/config.html.luan src/init.luan src/lib/Config.luan src/site.css |
diffstat | 4 files changed, 73 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/config.html.luan Wed Jun 15 20:59:13 2022 -0600 @@ -0,0 +1,41 @@ +local Luan = require "luan:Luan.luan" +local error = Luan.error +local Html = require "luan:Html.luan" +local html_encode = Html.encode or 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() +local Forum = require "site:/lib/Forum.luan" +local Config = require "site:/lib/Config.luan" + + +return function() + Io.stdout = Http.response.text_writer() +%> +<!doctype html> +<html> + <head> +<% head() %> + <title><%=Forum.title%> - Configuration</title> + <style> + textarea { + width: 90%; + height: 20em; + } + </style> + </head> + <body> +<% header() %> + <div content> + <h1>Configuration</h2> + + <textarea><%= html_encode(Config.text) %></textarea> + </div> +<% footer() %> + </body> +</html> +<% +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/init.luan Wed Jun 15 20:59:13 2022 -0600 @@ -0,0 +1,11 @@ +local Luan = require "luan:Luan.luan" +local error = Luan.error +local load = Luan.load or error() +local Config = require "site:/lib/Config.luan" +local Logging = require "luan:logging/Logging.luan" +local logger = Logging.logger "init" + +local fn = load(Config.text,"config") +fn() + +return true
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/lib/Config.luan Wed Jun 15 20:59:13 2022 -0600 @@ -0,0 +1,14 @@ +local Luan = require "luan:Luan.luan" +local error = Luan.error + +local Config = {} + +Config.default_text = [[ +local Forum = require "site:/lib/Forum.luan" + +Forum.title = "Your Forum" +]] + +Config.text = Config.default_text + +return Config