changeset 1735:4b56eff90040

add hosting.html
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 02 Oct 2022 17:32:00 -0600
parents 02d2a6c3bc6f
children a02a75e3daa8
files website/src/docs.html.luan website/src/hosting.html.luan website/src/tutorial.html.luan
diffstat 3 files changed, 51 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
diff -r 02d2a6c3bc6f -r 4b56eff90040 website/src/docs.html.luan
--- a/website/src/docs.html.luan	Sun Sep 18 15:38:27 2022 -0600
+++ b/website/src/docs.html.luan	Sun Oct 02 17:32:00 2022 -0600
@@ -26,6 +26,7 @@
 				<li><a href="pil.html">Programming in Lua (book)</a></li>
 				<li><a href="manual.html">Reference Manual</a></li>
 				<li><a href="diff.html">How Luan differs from Lua</a></li>
+				<li><a href="hosting.html">Web Hosting</a></li>
 			</ul>
 		</div>
 	</body>
diff -r 02d2a6c3bc6f -r 4b56eff90040 website/src/hosting.html.luan
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/website/src/hosting.html.luan	Sun Oct 02 17:32:00 2022 -0600
@@ -0,0 +1,48 @@
+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.docs_header or error()
+
+
+return function()
+	Io.stdout = Http.response.text_writer()
+%>
+<!doctype html>
+<html>
+	<head>
+<%		head() %>
+		<title>Luan Web Hosting</title>
+	</head>
+	<body>
+<%		header() %>
+		<div content>
+
+<h1>Luan Web Hosting</h1>
+
+<p>Luan is currently mostly used for building websites.  Luan <a href="https://hg.reactionary.software/repo/luan/file/tip/host">includes</a> a web hosting solution.  You can install this for your own use, or you can just use our web host for free.  I will explain how to use our web host.</p>
+
+<p>Start by creating an empty working directory.  In this working directory, create a sub-directory called <b>src</b>.  This will contain the website.  Now in the working directory, make shell script called <b>serve.sh</b> containing:</p>
+<pre>
+	luan luan:http/serve.luan src
+</pre>
+
+<p>Run this script and go to <a href="http://localhost:8080/">http://localhost:8080/</a> in your browser.  You should see the empty <b>src</b> directory.  Now put some HTML file in <b>src</b>.  You should see it in the browser.  If you click on the HTML file, it should render.  If you want HTML for the home page, use <b>index.html</b>.  To use Luan to generate HTML, use whatever.html.luan as described the <a href="tutorial.html">Luan tutorial</a>.</p>
+
+<p>Suppose your domain is <b>www.whatever.com</b>.  Our web host is <b>s1.luan.software</b>.  So create a DNS CNAME record pointing <b>www.whatever.com</b> to <b>s1.luan.software</b>.  Now make a shell script in the working directory called <b>push.sh</b> containing:</p>
+<pre>
+	luan luan:host/push.luan www.whatever.com password src
+</pre>
+<p>Replace "password" with whatever password you want.</p>
+
+<p>Running this script will create your website.  Running it again will update your website.</p>
+
+<p>If you are wondering why we offer this for free, it is because I am certain that modern scum (members of modern culture) will never use it.  Modern scum hate everything that is simple and good, and love overcomplicated crap.  So the free Luan hosting service will never have significant use, so I can easily offer it for free.</p>
+
+		</div>
+	</body>
+</html>
+<%
+end
diff -r 02d2a6c3bc6f -r 4b56eff90040 website/src/tutorial.html.luan
--- a/website/src/tutorial.html.luan	Sun Sep 18 15:38:27 2022 -0600
+++ b/website/src/tutorial.html.luan	Sun Oct 02 17:32:00 2022 -0600
@@ -4,7 +4,7 @@
 local Http = require "luan:http/Http.luan"
 local Shared = require "site:/lib/Shared.luan"
 local head = Shared.head or error()
-local docs_header = Shared.docs_header or error()
+local header = Shared.docs_header or error()
 
 
 return function()
@@ -17,7 +17,7 @@
 		<title>Luan Tutorial</title>
 	</head>
 	<body>
-<%		docs_header() %>
+<%		header() %>
 		<div content>
 
 <h1>Luan Tutorial</h1>