Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
lorem, ipsum and dolor
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed faucibus pretium nisl ut posuere. Donec vitae sem lobortis nulla molestie ornare. Morbi nec posuere ligula, ac iaculis velit. Proin finibus congue tortor vitae bibendum. Proin at ligula tellus. Duis scelerisque enim in dui luctus iaculis. Nullam ac neque suscipit, dapibus justo a,venenatis sem.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed faucibus pretium nisl ut posuere. Donec vitae sem lobortis nulla molestie ornare. Morbi nec posuere ligula, ac iaculis velit. Proin finibus congue tortor vitae bibendum. Proin at ligula tellus. Duis scelerisque enim in dui luctus iaculis. Nullam ac neque suscipit, dapibus justo a, venenatis sem.
Lorem | Ipsum |
---|---|
Dolor | Sit |
Amet | Consectetur |
Adipiscing | Elit |
Lorem | Ipsum |
curl
mkws.sh/newnight
| tar -xzvf -
mkwsnewnight-openbsd@2.0.0.tgz
is the OpenBSD binary version.
Sources
Rename the directory you unarchived earlier to your site's name:
mv ws.sh example.com && cd example.com
Create your first template named index.upphtml
, this is
required by mkws
:
cat <<EOF > index.upphtml
<p>
#!
echo hello, world
#!
</p>
EOF
Run mkws
:
./bin/mkws https://example.com
You just generated your first static site with mkws
.
You will now have an index.html
file in your .
root directory containing the following code:
<!doctype html>
<html lang=en>
<title>My website</title>
<meta charset=UTF-8>
<meta name=viewport content='width=device-width, initial-scale=1'>
<style>
</style>
<p>
hello, world
</p>
To create new pages, just add new *.upphtml
files
in the .
root directory, mkws
automatically
scans for them. You can create an aboutus.upphtml
or a
contact.upphtml
file for example to generate an
aboutus.html
or a contact.html
page.
For further customizations you can always modify your
./bin/mkws
or ./share/l.upphtml
files, in
fact, it's recommended.
mkws
uses *.upphtml
files as templates which
are processed via pp
,
a preprocessor that allows embedding sh
code in files of
any type by nesting it inside the #!\n
token,
where \n
is a new line.
As an example, for the following code:
<ul>
#!
i=1
while test $i -le 10
do
if test $((i % 2)) -eq 0
then
#!
<li class=even>$i</li>
#!
else
#!
<li class=odd>$i</li>
#!
fi
i=$((i + 1))
done
#!
</ul>
pp
outputs:
<ul>
<li class=odd>1</li>
<li class=even>2</li>
<li class=odd>3</li>
<li class=even>4</li>
<li class=odd>5</li>
<li class=even>6</li>
<li class=odd>7</li>
<li class=even>8</li>
<li class=odd>9</li>
<li class=even>10</li>
</ul>
This means you can script your templates in any way you prefer using
preferably, standard UNIX
tools for portability reasons.
Because
pp
uses sh
internally, double quotes ("
)
must be escaped in templates, so to get an actual double quote
("
) you have to write \"
.
This isn't a problem for HTML
because
quoting attribute values is optional and double quotes and single quotes
are interchangeable.
We recommend not quoting attribute values and using single quotes
('
) in special cases.
So instead of:
<!doctype html>
<html lang="en">
<title>My website</title>
<meta charset="UTF-8">
you would write:
<!doctype html>
<html lang=en>
<title>My website</title>
<meta charset=UTF-8>