shithub: ugh

ref: c1ec4d2286f4b779dd4cbb8c4fda47bbf78796f8
dir: /README.md/

View raw version
ugh!
====

ugh! is a website generator.

Theory of operation
-------------------

### Structure

The website source comprises page content files maintained under
top-level directory `data/`.

Top-level mk(1) targets drive the compilation of website source into
output directory `public/`.

The website template is defined by files in the `templates/` directory.
The templating engine is rc(1) heredocs—it is rather limited but should
be understandable.

The default template tries to load `public/css/style.css` stylesheet,
which doesn't exist by default.

### Transformation rules

Currently supported content files are markdown, html, and raw text.

Copies of the source files with `.html`, `.txt`, and `.md` extensions
are included verbatim in the output directory.

`.md` source files are compiled to an HTML page by a program
`bin/md2html`.  In turn, this program passes the markdown source file as
a first argument to `bin/filter-markdown` which must produce HTML body
content on its standard output.

### Filters

`bin/filter-markdown` and other filters (in the future) may be replaced
by users to use different processors or perform custom processing.

Install
-------

Copy this directory to a suitable place and make sure the dependencies
are met.

### Dependencies

9front version of `rc(1)` and `mk(1)` are core dependencies.
**NB** Other versions of rc are guaranteed not to work.

The default markdown filter `bin/mdtohtml` depends on the
[discount(1)](https://github.com/Orc/discount) markdown processor.
You can easily change it to something else.

Use
---

Create some content files in the `data/` directory and run:

	mk

in the top-level directory. This will generate pages and files
in the `public/` directory. Publish this whichever way you like.