eureka
eureka is a simple static site generator based on Devine Lu Linvega's generator for 100r.co. It renders this site.
eureka
simply reads .htm
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
).
- robust config options
- style-agnostic templating
- easily link between pages
- authomatically dithered thumbnails
- lightning fast
- twtxt and honknet integration
- versatile compact markup
- extensible via jamstack approach
The markup language looks like this:
// link to page {page name} // transclude page {/page name} // shorthand for arbitary link {*destination url|text} // shorthand for an image you can click to see the full sized version {:anchor-id|image url|alt text} // shorthand for an image with arbitrary link destination {?anchor-id|destination url|image url|alt text} // shorthand for an audio player {_/path/to/media} //shorthand for a video player {]id|/path/to/video|/path/to/thumbnail|fallback text for download link (if HTML5 video is not supported)} // shorthand for paragraphs, can embed other markup inside it {¶graph text {with a link} {@and some bold text}} // shorthand for ordered lists, can embed other markup inside it {# {-item one} {-item two} {-item three} } // shorthand for unordered lists, can embed other markup inside it {, {-item one} {-item two} {-item three} } // shorthand for bold {@bold text} // shorthand for italic {\italic text} // shorthand for code {`short code} // shorthand for pre {$longer code} // shorthand for quote {'short quote} // shorthand for blockquote {>longer quote} // shorthand for strikethrough {~crossed-out text} // shorthand for level 3 heading (levels one and two are taken care of by the site title and the page title) {!heading text} // shorthand for level 4 heading {.heading text} //shorthand for tables {[column 1 header|column 2 header|column 3 header} {|simple data|{@bold data}|{*https://nilfm.cc|link data}} {|more|and more|and more data!} {;} // shorthand for publish date (eg, for blog posts; renders as <time class='publish-date'>) {+2022-02-22} // shorthand for explicit monospace, sans, and serif font respecively: {=some mono text} {(some sans serif text} {)some serif text} // shorthand for a pictured directory/list item {%page name|picture} // shorthand for a shop listing {^payment-link|description|img1|alttext1|...|imgn|alttextn}
eureka
defines the following constants as C macros in the config.h
to allow easy customization:
- LEXICON_SIZE: max size of the
Lexicon
, corresponds to the number of pageseureka
can keep track of - TAG_BODY_SIZE: max size for an individual markup body (in bytes)
- NAME: the title of the site
- DOMAIN: currently unused
- LOGO_HTML: HTML to put in the header h1 tag, verbatim
- ABOUT_HTML: HTML content for the front page, placed between <header> and <nav>
- CONTACT_HTML: the contact info line at the bottom of every page (except the front page, where it would typically already be in ABOUT)
- FOOTER_HTML: arbitrary footer HTML; in the case of nilFM, it shows SVG icons which link to the hack lab, the Light Crystal Systems website, and the Merveilles webring
- LICENSE_HTML: the license link at the bottom of every page
- SITEROOT: the path where the rendered HTML is placed; include trailing slash
- MAINCSS and FRONTCSS: to differentiate styles used for the landing page and the rest of the site
- TWTXT: path to the twtxt file relative to the SITEROOT; if you don't want twtxt on the front page, use a nonexistent filename
- DEPLOY_DEST and DEPLOY_IDENT: parameters for the remote endpoint to deploy to and the name of the private key to use respectively for the deployment script
- IS_NAV_IN_HEADER: whether the nav is part of the header or its sibling
- CONTACT_ADDRESS: email address used in the item listing for further inquiries; can be intrepolated into CONTACT_HTML
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 at the time of writing, from about 13MB to just under 1MB.
eureka
and its helpers tw.sh
and underbbs.sh
expect the twtxt file to be in descending order (latest first), although this may change in the future. In the future honknet and other syndication will be handled by underbbs's CLI.'