diff -urP mkws/4.0.5/mkws/LICENSE mkws/4.0.6/mkws/LICENSE
--- mkws/4.0.5/mkws/LICENSE Sun Sep 13 22:15:55 2020
+++ mkws/4.0.6/mkws/LICENSE Wed Jan 13 19:58:00 2021
@@ -1,6 +1,6 @@
ISC License
-Copyright (c) 2020, Adrian Emil Grigore <adi@tilde.institute>
+Copyright (c) 2021, Adrian Emil Grigore <adrian.emil.grigore@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
diff -urP mkws/4.0.5/mkws/README mkws/4.0.6/mkws/README
--- mkws/4.0.5/mkws/README Thu Nov 26 16:46:18 2020
+++ mkws/4.0.6/mkws/README Wed Jan 13 19:58:00 2021
@@ -1,37 +1,120 @@
-# `mkws(1)`
+# `mkws`
+A small, no bloat, minimalist static site generator using `sh` as a
+templating language.
+
## Requirements
-A UNIX like operating system is recommended like
-[macOS](https://www.apple.com/macos/),
-[Linux](https://kernel.org) or
-[BSD](https://en.wikipedia.org/wiki/List_of_BSD_operating_systems)
-variant (our favorites are [OpenBSD](https://openbsd.org) and
-[Void Linux](https://voidlinux.org/)).
-Also, familiarity with the command line is good to have.
-`mkws(1)` can also run on [Windows](https://www.microsoft.com/windows)
-via the
-[Windows Subsystem for Linux](
-https://docs.microsoft.com/en-us/windows/wsl/install-win10).
+We provide statically compiled binaries for [Linux](mkws@4.0.5.tgz)
+or [OpenBSD](mkws-openbsd@4.0.5.tgz). It can also run on
+[Windows](https://www.microsoft.com/windows) via the
+[Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)
+for other UNIX like operating systems, you
+can build from sources.
-## Installation (applies to [Linux](https://kernel.org))
+## Install `mkws`
-You'll have to download [https://mkws.sh/mkws@4.0.5.tgz](
-https://mkws.sh/mkws@4.0.3.tgz). Once you have the archive, unpack
-it and rename the newly created directory:
+On a Linux machine, just download the archive from
+[https://mkws.sh/mkws@4.0.6.tgz](https://mkws.sh/mkws@4.0.6.tgz) or in
+the terminal, assuming `wget` is installed, type:
- mkdir -p ~/src/
- cd ~/src/
- tar -xzfv ~/Downloads/mkws@4.0.5.tgz
- mv ws.sh example.com
+ wget -O - https://mkws.sh/mkws@4.0.6.tgz | tar -xzvf -
-## Make web site
+## File Hierarchy
-Create an `index.upphtml` file, it will be preprocessed with
-[`pp(1)`](https://mkws.sh/pp.html), and run `./bin/mkws` with the url
-of your web site:
+Inside the downloaded archive you will find the following file structure:
- cd example.com
+ .
+ |-- bin
+ | |-- lmt
+ | |-- mkws
+ | `-- pp
+ `-- share
+ |-- l.upphtml
+ |-- man
+ | -- man1
+ | |-- lmt.1
+ | |-- mkws.1
+ | `-- pp.1
+ |-- s.uppcss
+ `-- sitemap.uppxml
+
+* `.`
+The root directory, it holds the template files and other generated
+files, including `*.html`, `*.css`, `*.js` and `sitemap.xml` files.
+ * `./bin`
+ Holds the static site generator's binaries, they're used to generate
+ the static site.
+ * `./bin/lmt`
+ Small utility part of [`lts`](https://mkws.sh/lts.html) for
+ printing a file's last modification time used to generate
+ timestamps.
+ * `./bin/mkws`
+ The _main_ script, the actual static site generator, when called
+ from the command line via `./bin/mkws <url>`, it scans the `.`
+ root directory for `*.upptml` files, `mkws`'s template files,
+ preprocesses them via [`pp`](https://mkws.sh/pp.html) and
+ renders them inside the `share/l.upphtml` layout file outputing
+ an `HTML` file for each one. `index.upphtml` is transformed to
+ `index.html`, `docs.upphtml` is transformed to `docs.html`,
+ etc. It also creates the main `CSS` file, `s.css` from
+ `share/s.uppcss` and the `sitemap.xml` file from
+ `share/sitemap.uppxml`.
+ * `./bin/pp`
+ The [`pp`](https://mkws.sh/pp.html) preprocessor, it allows
+ nesting `sh` code in any text file. It it used by the _main_
+ `./bin/mkws` script to preprocess any `.upp*` file.
+ * `./share`
+ Holds any files that are shared between different components of the
+ static site generator.
+ * `./share/l.upphtml`
+ The main layout file, it holds the common parts of your website.
+ Elements like `html`, `body`, `head` are located here. The standard
+ layout file found in the archive, which is also part of the `base` theme is:
+
+ <!doctype html>
+ <html lang=${LANG%%_*}>
+
+ <head>
+
+ <title>My website</title>
+
+ <meta charset=${LANG##*.}>
+ <meta name=viewport content='width=device-width'>
+
+ <link rel=icon href=favicon.ico type=image/x-icon>
+ <link rel=stylesheet
+ href=s.css?$(lmt -f '%Y-%m-%dT%H:%M:%SZ' s.css | cut -d' ' -f1)>
+
+ </head>
+
+ <body>
+
+ #!
+ pp "$1"
+ #!
+
+ </body>
+
+ </html>
+
+ * `./share/man`
+ `man` pages
+ * `./share/s.upcss`
+ `CSS` template. It's also processed via
+ [`pp`](https://mkws.sh/pp.html) so it's scriptable via `sh` code.
+ * `./share/sitemap.uppxml`
+ `sitemap.xml` template.
+
+## Generate the Static Site
+
+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>
#!
@@ -39,23 +122,77 @@
#!
</p>
EOF
+
+Run `mkws`:
+
./bin/mkws https://example.com
-You can create more `*.upphtml` files to make additional pages, the
-layout file is held in `./share/l.upphtml`.
+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:
-Also, you can always modify your `./bin/mkws` script, if it's the case.
+ <!doctype html>
+ <html lang=en>
+
+ <head>
+
+ <title>My website</title>
+
+ <meta charset=UTF-8>
+ <meta name=viewport content='width=device-width'>
+
+ <link rel=icon href=favicon.ico type=image/x-icon>
+ <link rel=stylesheet
+ href=s.css?2020-12-12T18:42:29Z>
+
+ </head>
+
+ <body>
+
+ <p>
+ hello, world
+ </p>
+
+ </body>
+
+ </html>
-## Important!
+## Note
-Because [`pp(1)`](https://mkws.sh/pp.html) uses
-[`sh(1)`](
+Because [`pp`](https://mkws.sh/pp.html) uses
+[`sh`](
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sh.html)
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 [double quoting(`"`) attribute values is
-optional and double quotes (`"`) and single quotes(`'`) are
+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](
https://html.spec.whatwg.org/multipage/syntax.html#attributes-2).
We recommend not quoting attribute values and using single quotes (`'`)
in special cases.
+
+So instead of:
+
+ <!doctype html>
+ <html lang="en">
+
+ <head>
+
+ <title>My website</title>
+
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width">
+
+you would write:
+
+ <!doctype html>
+ <html lang=en>
+
+ <head>
+
+ <title>My website</title>
+
+ <meta charset=UTF-8>
+ <meta name=viewport content='width=device-width'>
diff -urP mkws/4.0.5/mkws/mkws mkws/4.0.6/mkws/mkws
--- mkws/4.0.5/mkws/mkws Sun Sep 13 22:15:55 2020
+++ mkws/4.0.6/mkws/mkws Wed Jan 13 19:58:00 2021
@@ -1,7 +1,7 @@
#!/bin/sh -e
usage() {
- >&2 printf "usage: %s url [path]\n" "$(basename "$0")"
+ >&2 printf "usage: %s url [path]\\n" "$(basename "$0")"
exit 1
}
@@ -13,7 +13,7 @@
if ! test -f "$srcdir"/index.upphtml
then
- >&2 printf "no index.upphtml file found\n"
+ >&2 printf "no index.upphtml file found\\n"
exit 1
fi