added layouts, db support

This commit is contained in:
2024-03-17 16:03:28 -05:00
parent bb7c69e749
commit dd40016775
6 changed files with 42 additions and 21 deletions

View File

@ -1,29 +1,14 @@
<!-- views/index.etlua -->
<script src="/static/htmx.min.js"></script>
<h1>Hello world</h1>
<p>Welcome to my page</p>
<p>The missile guidance system works as follows</p>
<form>
<fieldset>
<legend>Give Us Money</legend>
<input type="file"></input>
<input type="text"></input>
</fieldset>
<fieldset>
<label>Do it</label>
<input type="number"></input>
</fieldset>
</form>
<br>
<button hx-post="/clickme" hx-target="#clickable">Click me</button>
<button hx-post="/clickme" hx-target="#clickable">Start</button>
<p id="clickable"></p>
<ol>
<!--
<p><% for i, thing in pairs(text) do %>
<li><%= thing %></li>
<% end %>
</p>
</ol>
-->

12
views/layout.etlua Normal file
View File

@ -0,0 +1,12 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title><%= page_title or "My Page" %></title>
</head>
<body>
<h1>Peradventure</h1>
<% content_for("inner") %>
</body>
</html>