Skip to content

kokkonisd/mrbones

Repository files navigation

mrbones

A bare-bones static site generator in the form of a single Bash script.

Installation

Dependencies

Currently, mrbones is only supported on Linux systems. It has the following dependencies:

You can use the Makefile to install/uninstall mrbones:

$ sudo make install    # you can also use DESTDIR to specify *where* to install
$ sudo make uninstall  # use same DESTDIR as for `make install`

Use

You can invoke mrbones like so:

$ mrbones [option(s)] [root_site_dir]

If not specified, [root_site_dir] defaults to . (the current directory). You can see the options by running mrbones --help.

By default, mrbones will copy everything in the root_site_dir to a new directory called _site/, which will contain the generated static site. However, HTML templates can be used to make development easier. These can be put under _templates/ in root_site_dir. This directory is special to mrbones and will not be copied verbatim; instead, templates can be put in there, that may be used by other pages. These enable the following directives:

  • @include <FILE>. The include directive copies a template file verbatim into the file that contains it. For example, consider two pages:
    • _templates/main.html containing "hello!";
    • index.html containing "@include main.html\ngoodbye!". The generated _site/index.html page will contain "hello!\ngoodbye!", as _templates/main.html was included in index.html. Note that there should be at most one include directive per line, and the line should not contain anything else.
  • @use <FILE>. The use directive fills in a template with the content of another page. For example, consider two pages:
    • _templates/main.html containing "<html>@content</html>";
    • index.html containing "@use main.html\nhello!". The generated _site/index.html page will contain "<html>hello!</html>", as index.html was used to fill the _template/main.html template. Note that there should be at most one use directive per line, and the line should not contain anything else. In addition, the template used in the use directive must contain at least one @content directive, to indicate where the page's content should be placed. Multiple @content directives will lead to the page's content being placed in multiple parts of the template.

Contributing

See CONTRIBUTING.md.

License

mrbones by Dimitri Kokkonis is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.