nilFM

eureka

eureka is a simple static site generator based on Devine Lu Linvega's generator for the new version of 100r.co. It renders this site.

eureka simply reads files in inc/ and applies a template around them, giving them a <header>, <nav>, and <footer>. The <nav> content is also located in inc/meta.nav.htm, and, contrary to 100r.co's engine, special rules are applied when templating around it to render the landing page (index.html).

Filenames in inc/ can be referenced and linked to in other files there by surrounding them with curly brackets:

{page name}

The actual file name should have underscores between the words but the reference should use spaces. If you put a forward-slash before the filename (but inside the brackets), the file will be injected as a section in the page:

{/page name}

In addition to those file injection/linking references implemented by Devine, there are esoteric templating formats I came up with for eureka. This one creates arbitrary hyperlink text:

{*href|text}

This one makes hyperlinked image (ie, an image inside an anchor hyper-referencing itself)

{:anchorid|imgsrc|alttext}
and one for images with a hyperlink destination different than the image source:
{?anchorid|href|imgsrc|alttext}

This one is for embedding an mp3 player:

{_audiosrc}

All of these make embedding links and media into a page much more streamlined and less tedious than having to deal with raw html for everything.

eureka defines the following constants as C macros:

In addition, there is a thumbnailer that uses ImageMagick to create low-bandwidth thumbnails at 500px wide and 16 colors, and store them in a subdirectory alongside the full size images. eureka has a function to automatically replace the inline images within pages with the thumbnails, but leave the links they point to untouched. This reduced the page size of images, one of the heaviest pages on this site, from about 13MB to just under 1MB.

Eureka also parses a twtxt file at SITEROOT/twtxt.txt and display the latest three entrires on the front page. It does expect the file to be in descending order.

There isn't much else to it, and that's the way I like it!