dixonary / microcosmos

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

  1. Grab a copy of microcosmos via clone or download the zip.
  2. Run cabal new-build.
  3. Either run directly from the dist-newstyle folder, or move that binary elsewhere, or use cabal run.

From Releases

  1. Visit releases.
  2. Download the latest version for your system (currently Linux only).
  3. Set file permissions: $ chmod u+x ./mc
  4. 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 with posts, static, and template 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.

About


Languages

Language:Haskell 91.4%Language:HTML 7.8%Language:CSS 0.8%