Moutonjr Geoff 6d7d598290 Init commit
2020-11-21 15:08:16 +01:00
2020-11-21 15:08:16 +01:00
2020-11-21 15:08:16 +01:00
2020-11-21 15:08:16 +01:00
2020-11-21 15:08:16 +01:00
2020-11-21 15:08:16 +01:00
2020-11-21 15:08:16 +01:00

Test static site generation

Introduction

This small snippet aims to convince that you can render all static pages at once using SSG-scheme.

OK, what should I see?

Scheme is as follows:

  • Aim is to deliver plain ol' HTML pages by web server. No, no application server accepted; This is best for most of services!
  • Problem: You have redundant content, and you don't want the hassle to maintain HTML files:
    • No functions, so redundant code;
    • Can't properly handle modular breakdown (header, footer, sections);
    • When you made it work once, shall you re-understand everything 6 months later to thange stubs?

Here is how it works:

  • We store relevant data in a YAML file, say settings.yml.
  • We Use Nunjucks, the millenials way to code, to generate Jinja2-styled webpages on steroids.
  • We Then compile the whole once, and after we got static HTML for basically every use.

What repo doesn't contain:

  • All Nunjucks killer features.

Dependencies

Install NodeJS and npm

Build

  npm run build

Serve your webserver to display the public folder as webroot.

Description
A NPM, NodeJS-based stub to generate static files.
Readme 28 KiB
Languages
JavaScript 86%
HTML 14%