t3h-static-site-generator

1.1.1 • Public • Published

t3h-static-site-generator

NPM package is being tested, do not use.

My static site generator, used for my own website.

Written for use with Node.js 6+, supports posts in markdown with GFM syntax block and code highlighting.

I didn't like trying to learn the quirks and nuances of other site generators. This was used as an opportunity to learn some modern JavaScript and make my site work exactly how I want. I like to learn how and why things work so writing things from scratch makes sense.

The development of this project is developed using Github issues via a Waffle board: https://waffle.io/t3hmun/t3h-static-site-generator

This project is a neatly NPM packaged evolution of my slightly older site generator. The aim of this incarnation is to make it easy to use with GitLab CI.

Operation

Publishing

The site is generated by a single command:

$ node publish

The process involves:

  • Loading templates written in Pug that define the common layout of all pages.
  • Compiling posts written in Markdown and then inserting them into the Pug templates.
  • Rendering pure pug pages using the templates (including auto-generated post indexes).
  • Compiling CSS styles from LESS files.
  • TODO: Minfy JS.

I've tried to minimise the amount of external code, however Markdown, templating and CSS libraries are far too be to DIY (also pointless).

Preview

The preview mode does not launch a local server like most site generators. Instead it re-writes all the URLs as local files file:///, which works just fine on most browsers. This is also applied to all links; all links are coded to prepend the site's base-url in pug.

There is no clever code for properly resolving full links in the Markdown yet. Generally links withing the markdown are relative.

To generate an offline preview:

$ node publish test

Status

Updated 08th March 2017

In development, not ready for use (see Waffle board for progress).

First npm test release in testing.

The development is split into Milestones that signify a major step.

Initial Import Milestone

STATUS: Complete on time.

This was importing the old project and making it suitable for deployment as an NPM package.

Features Milestone

STATUS: Always ongoing.

Milestone to get all basic site features working properly.

Appearance Milestone

This is an infinite ongoing category for aesthetic tweaks. Always regarded as low priority.

HTTPS and Custom URL Milestone

This is the milestone to get the site (my site) working on GitLab CI (or any service tbh), with a custom URL using proper HTTPS.

NPM Package Milestone

STATUS: In progress.

License

GPL3

Package Sidebar

Install

npm i t3h-static-site-generator

Weekly Downloads

0

Version

1.1.1

License

GPL-3.0

Last publish

Collaborators

  • t3hmun