All Projects → jaredhanson → kerouac

jaredhanson / kerouac

Licence: MIT license
Poetic static site generator for Node.js.

Programming Languages

javascript
184084 projects - #8 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to kerouac

prpl
A modular static site generator built for longevity
Stars: ✭ 44 (-45%)
Mutual labels:  static-site-generator, ssg
Stencil
A toolchain for building scalable, enterprise-ready component systems on top of TypeScript and Web Component standards. Stencil components can be distributed natively to React, Angular, Vue, and traditional web developers from a single, framework-agnostic codebase.
Stars: ✭ 9,880 (+12250%)
Mutual labels:  static-site-generator, ssg
frontman
💎 A Ruby-based static website generator
Stars: ✭ 103 (+28.75%)
Mutual labels:  static-site-generator, ssg
contentz
Create Content, Get a Highly Optimized Website
Stars: ✭ 57 (-28.75%)
Mutual labels:  static-site-generator, ssg
eleventy-plugin-cloudinary
An Eleventy shortcode that allows you to add an image from your cloudinary account
Stars: ✭ 28 (-65%)
Mutual labels:  static-site-generator, ssg
Next.js
The React Framework
Stars: ✭ 78,384 (+97880%)
Mutual labels:  static-site-generator, ssg
graphql-ssg
GraphQL data based Static Site Generator.
Stars: ✭ 30 (-62.5%)
Mutual labels:  static-site-generator, ssg
wordpress-scaffold
The scaffold for GRRR's WordPress Pro setup.
Stars: ✭ 16 (-80%)
Mutual labels:  static-site-generator, ssg
plain
network .md into .html with plaintext files
Stars: ✭ 70 (-12.5%)
Mutual labels:  static-site-generator, ssg
presta
Minimalist serverless framework for SSR, SSG, serverless APIs and more.
Stars: ✭ 89 (+11.25%)
Mutual labels:  static-site-generator, ssg
trailing-slash-guide
Understand and fix your static website trailing slash issues!
Stars: ✭ 255 (+218.75%)
Mutual labels:  static-site-generator, ssg
gisture
A minimal and flexible blog generator based on GitHub Gist.
Stars: ✭ 24 (-70%)
Mutual labels:  static-site-generator, ssg
leven
😋 Make your own blog!
Stars: ✭ 54 (-32.5%)
Mutual labels:  static-site-generator
sistine
A simple, flexible, productive static site generator written entirely in Ink
Stars: ✭ 17 (-78.75%)
Mutual labels:  static-site-generator
pandocomatic
Automate the use of pandoc
Stars: ✭ 123 (+53.75%)
Mutual labels:  static-site-generator
vite-plugin-image-presets
🖼 Image Presets for Vite.js apps
Stars: ✭ 164 (+105%)
Mutual labels:  ssg
jekyll-rdf
📃 A Jekyll plugin to include RDF data in your static site or build a complete site for your RDF graph
Stars: ✭ 46 (-42.5%)
Mutual labels:  static-site-generator
Clownfish
Smart Content Management System using Spring Boot
Stars: ✭ 14 (-82.5%)
Mutual labels:  static-site-generator
personal-website
Personal website – made with Next.js, Preact, MDX, RMWC, & Vercel
Stars: ✭ 16 (-80%)
Mutual labels:  ssg
crisp-react
React boilerplate written in TypeScript with a variety of Jamstack and full stack deployments. Comes with SSR and without need to learn a framework. Helps to split a monolithic React app into multiple SPAs and avoid vendor lock-in.
Stars: ✭ 147 (+83.75%)
Mutual labels:  static-site-generator

Kerouac

Version Build Quality Coverage Dependencies

I saw that my life was a vast glowing empty page and I could do anything I wanted.

-- Jack Kerouac

Kerouac is a static site generator written in Node.js. It is the simplest possible tool for transforming content written using lightweight markup, such as Markdown, into a complete website.

For highly-customized sites, Kerouac is also a powerful framework inspired by Express. Each page in the generated website is declared as a route, which can take advantage of middleware purpose-built for static pages. Never before has been building a hybrid static and dynamic site been so consistent.

Install

$ npm install kerouac

Usage

var kerouac = require('kerouac');
var site = kerouac();

site.set('base url', 'http://www.example.com/');
site.content('content');
site.assets('public');

site.generate(function(err) {
  if (err) {
    console.error(err.message);
    console.error(err.stack);
    return;
  }
});

Content, Layouts, and Assets

A typical static site consists of a content written in Markdown, and layouts which structure the content into an HTML page.

Kerouac will render all content within a directory:

site.content('content');

Content contains a section known as "front matter" surrounded by three dashes (---). Front matter specifies metadata about the content, including which layout should be used when generating a web page.

---
layout: 'main'
title: 'Welcome'
---

# Hello

Welcome to my website!

Layouts are located in a layouts directory and are rendered using EJS.

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title><%- title -%></title>
  </head>
  <body>
    <%- content -%>
  </body>
</html>

Most web sites also contain assets including images, stylesheets, and scripts that don't need preprocessing. Kerouac will copy all assets in a given directory when generating the site:

site.assets('public');

Note that markup and layout rendering is fully customizable. Alternatives, such as Textile and Jade, can be used to suit your preferences.

Plugins

Many websites contain sections, such as a sitemap or blog, which conform to an established set of conventions. Kerouac supports plugins, which can be used to bundle up these sections into modules that can be reused accross multiple sites.

For example, to generate a sitemap for your site, simply add the kerouac-sitemap plugin:

site.plug(require('kerouac-sitemap')());

A list of plugins developed by the community is available on the wiki.

Middleware

Just like Express and Connect, Kerouac allows pages to be generated using middleware at both the whole-site and per-page level. This is the lowest-level API, and content, assets, and plugins (as detailed above) are built upon this foundation.

The majority of sites will never need to operate at this level. If needed, the API is simple.

// whole-site middleware
site.use(function(page, next) {
  console.log('generating ' + page.path);
  next();
});

// page-level middleware
site.page('/hello.txt', function(page, next) {
  page.write('Hello!');
  page.end();
});

A list of middleware developed by the community is available on the wiki.

Examples

The following sites are built with Kerouac, and have public code repositories that illustrate how to develop using Kerouac's API.

License

The MIT License

Copyright (c) 2012-2017 Jared Hanson <http://jaredhanson.net/>

Sponsor

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].