mmmm

mmmm is a static website/blog engine based on m4. Actually, it can generate anything. Its features:

  • depends only on POSIX tools (m4, make, file and sh, meaning no 3rd party dependencies at all on POSIX systems)
  • m4-based templates (portable, as not HTML specific; generate whatever you want, simple text, SQL upsert statements, etc.)
  • static pages, as well as news/blog
  • tags
  • RSS2 generation (per site and also per tag)
  • static data (can optionally be passed through m4, also; e.g. m4-generated css, so no need for sass, etc.)
  • works on Linux, OS X and *BSD with GNU and BSD make and m4

Design

Running 'make all' will generate static web files using data from content/yoursite, with template templates/yourtemplate and write everything to the out-folder.

To write other data and use a specific template, set TEMPLATE and BLOG on invocation of make:
make TEMPLATE=templatename BLOG=blogname all

Files and folders in ./copyin, and in paths added using addmedia(relpath) (relative to content or template, depending on where this macro is used) are copied to out verbatim, with files with .m4 suffix preprocessed by m4. The latter allows for flexible generation and preprocessing, e.g. useful for css files. Defining COPYSTRATEGY=link on invocation of make tries to avoid copying data to out if it doesn't need processing, and uses symlinks for performance.

The file structure of your site requires only a content/yoursite/site.m4 file, which contains your site's sources. Inside of that file use the following macros for generation of articles or static pages (tags and rss are generated on the fly). Protip: use m4 include()s to not have a single, huge file with all the content.

  • startentry(post title,author,year,month,day,list of space separated tags)... content ...endentry
  • startpage(page title,optional name of generated file for page)... content ...endpage

Useful notes

  • use SITE as a shortcut to set BLOG and TEMPLATE to the same value
  • make serve starts a local webserver serving the files in out (requires python)
  • make push pushes the generated site to a CDN (see Makefile what to define and how to specify which CDN)
  • setting HTMLEXT on make can be used to add a file extension to every generated file