microcosmos
A tiny blogging platform
See https://dixonary.co.uk/mc for more information.
Build and Run
Prerequisites:
- A version of the Haskell platform which includes
cabal
, if you are compiling it yourself. - Libgmp
The program has only been tested on Linux but there is no obvious reason for it to break elsewhere.
Self-compiled
- Grab a copy of microcosmos via clone or download the zip.
- Run
cabal new-build
. - Either run directly from the
dist-newstyle
folder, or move that binary elsewhere, or usecabal run
.
Releases
From - Visit releases.
- Download the latest version for your system (currently Linux only).
- Set file permissions:
$ chmod u+x ./mc
- Run:
$ MC_PORT=[your port number] ./mc
How it works
You will probably want to read the source code (it's only 400 lines), but here's the gist:
- On first run,
mc
will populate the working directory withposts
,static
, andtemplate
folders along with some very basic contents. - You can modify any of these files at runtime and the changes will be reflected on the website automatically.
- The templates include
<PLACEHOLDER name="...">
tags. These must be formatted exactly in this way, and the relevant variable is interposed into the template. The date is represented in human format. - Adding a
.dirname
file to a folder will set the name of the directory as it appears in the relevant placeholders.