Home

Awesome

mrkiffie.com

This is my static site generator. It uses metalsmith to do most of the heavy lifting. There are a few custom plugins and handlebar helpers to do the finishing touches.

Installation

git clone https://github.com/mrkiffie/mrkiffie.com.git mrkiffie.com
cd mrkiffie.com
npm install
npm start

npm start

Starts a development server instance on http://localhost:7000

Dev features

npm run build

Generates a clean build of the static site from scratch

Build features

npm run lint

Runs all the javascript files through eslint

npm run deploy

Creates a clean build and then publishes the changes to the gh-pages branch. Requires the deploy.sh script from git-directory-deploy to be installed

Source files

The source files are structured as described by the following tree

src/
├── assets/
│   ├── css/           // styles css and less
│   ├── img/
│   └── js/            // javascript files
├── content/
│   ├── posts/
│   │   ├── <year>/    // these contain posts in markdown organized by year
│   ├── 404.md         // customizable 404
│   ├── about.md       // example of a page
│   └── site.json      // contains site config meta data, e.g. title, links, etc.
├── layouts
│   ├── partials
│   │   ├── footer.hbs
│   │   ├── header.hbs
│   │   └── html-head.hbs
│   ├── blog-index.hbs
│   ├── blog-post.hbs
│   ├── index.hbs
│   └── offline.hbs    // custom offline template
├── static             // static asset that should be in the root
│   └── favicon.ico
├── manifest.json      // manifest for web apps
└── service-worker.js  // service worker to enable offline access to previously accessed content

Frontmatter

Certain frontmatter has special value to the build system.

Example list page

---
title: Writings
layout: blog-index.hbs
listing: true
---

Example blog post

---
title: "in and around my head"
date: 2007-08-01
category: "random"
layout: blog-post.hbs
styles:
    - "fancy-quotes.css"
---

Example 404

---
layout: index.hbs
permalink: false
robots: "noindex, follow"
title: 404
---

Example custom script

---
layout: offline.hbs
robots: "noindex, follow"
title: Offline
listing: true
scripts:
    - offline.js
---