Ferron is a fast and simple static website generator made with Lua.
Clone or download

README.md

Ferron

Ferron is a static site generator (SSG) crafted with Lua >= 5.3.

This documentation is a WIP.

Installation

  1. Make sure Lua 5.3 (or up), and Luarocks are installed on your machine.
  2. Then:
    • git clone git@github.com:hs0ucy/Ferron.git && cd Ferron
    • git submodule update --init && git submodule update --recursive --remote
  3. The rest of the installation process is made with the Ferron CLI (command-line interface) named cornelius.
  4. So make sure the cornelius file have the right permissions to be execute has a script.
  5. Otherwise: chmod a+x cornelius.
  6. After that ./cornelius install. The install will check if Luarocks is installed on your system and then install all the dependencies with it.
  7. If all went well, you are up and ready to create your site.

Dependencies

Get Started

First you need to copy the default site and give it the name of the website you want to create... to do so just type this and follow the instructions:

  • ./cornelius start

After that with your favorite texteditor or IDE edit the site-config.lua to meet the needs of your web site:

  • emacs site-config.lua

Architecture of a Ferron website

  • sites

    • .gitignore
    • ferron-ssg.tld
      • archetypes
        • .gitignore
        • doc.json
        • doc.md
      • content
        • index.json
        • index.md
      • public_html
        • .gitignore
      • site-config.lua
      • static
      • templates
  • To simply build a web site:

    • ./cornelius build
  • To build a site in development mode:

    • ./cornelius build --dev

Content

All the content of your site should be markdown (*.md) file and belongs in the content/ repository. That folder must contains at least an index.md file and an index.json. JSON files are used for the metadatas of the web pages.

Archetypes

Archetypes are presets files for writing content faster. When you create a content through an archetype, the basic metadatas of your markdown file are prefilled and it is put in the right place of the content tree.

Create a content from an archetype

  • ./cornelius create

If it is a success Ferron will output something like this :

  • - The file '/home/hs0ucy/Documents/fakestache-ssg/content/sample/2017/03/this-is-my-first-content-made-from-an-archetype.md' hab been created.

Now you can open the file you have created and start to write right away whithout the need of filling the metadatas.

Templates

Ferron uses the mustache template engine (for lua) to give more flexibility to build your theme.