0.0
The project is in a healthy, maintained state
A slightly opinionated static website generator for those who like working in html and mustache
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.3
~> 13.0

Runtime

~> 3.3
~> 1.0
~> 1.0
 Project Readme

Gryphon Nest

Yet another static website builder. Starting as a simple ruby script to build my own website it's now been converted into a gem for others to use. The main audience of this gem is those who like to work with HTML and Mustache, so probably just me :)

Installation

To install run:

[sudo] gem install gryphon_nest

Or include in your websites Gemfile

gem 'gryphon_nest', '~> 2.0'

And run

bundle install

Usage

Gryphon provides the executable nest which currently supports two commands:

  • build: Generates your website and stores it in the _site folder.

  • serve: Builds your website and starts a local server for viewing the built site.

Project Strucutre

Gryphon requires this folder structure:

project_directory/
        content/
            index.mustache
            main.css
            favicon.ico
        layouts/
            main.mustache
        data/
            index.yaml

Content

Where you put all the content for your website. Mustache template files are expanded to _site/basename/index.html for clean URLs e.g. contact.mustache -> _site/contact/index.html, except for the index.mustache file which is saved as index.html. Other files are copied as is and in the same folder structure to the output folder.

Gryphon will always rebuild template files but will only move asset files if they have been modified. If a file exists in the output folder that doesn't exist in the content folder. It will be deleted.

Layouts

If a main.mustache file exists in this folder, it will be used as the wrapper around all mustache files inside your content folder.

An example of this file is:

<!DOCTYPE html>
<html lang="en-GB">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{{title}}</title>
    <link rel="stylesheet" href="styles/main.css">
  </head>
  <body>
    {{{yield}}}
  </body>
</html>

The {{{yield}}} block is required and will be replaced with the content of the transformed content file.

Data

An optional folder containing yaml files providing context for mustache when it renders a template file. Gryphon will use the data file with the same basename as the context file it's currently processing eg contact.mustache -> contact.yaml. The provided context will also be available in the layout file if provided.

Migrating from Version 1

  • The asset and content folders have been merged into just the content folder.
  • Datafiles no longer support the yml file extension
  • Individual layout files are no longer supported.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/chrisBirmingham/gryphon_nest.