Project

mr-edward

0.0
No release in over 3 years
Statis site generator
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

~> 3.9
~> 2.7
~> 1.9
 Project Readme

Edward, a simple robust static site generator for Ruby

Edward is inspired by Jekyll (Edward Hyde is the name of Dr Jekyll’s alter ego). However, Edward uses Tilt for templating instead of Liquid. The freedom provided by Tilt as well as Edwards simplicity create a very powerful environment.

At its core Edward only does one thing, given a website it will convert certain template files (called "pages") to a different format (typically .html). It has a concept of layouts and include partials, but nothing else. Other functionality may be implemented by hand.

Ruby has some very powerful templating engines like Slim, Haml, Erb and AsciiDoc. This project tries to leverage these tools as much as possible.

Warning
Edward is still unstable and being actively worked on

Getting started

$ gem install mr-edward
$ edward serve

Layouts

You may place layouts in _layouts. Layouts call yield to get their inner content.

// _layouts/default.slim
doctype html
html
  head
    title = @page[:title]
    style == include "style.css.str", background_color: @page[:style, :background_color] || "red"
  body == yield

Layouts may optionally use [_front_matter].

Layouts may be nested. Just use another layout attribute in your layout.

---
# _layouts/post.slim
layout: default.slim
title: <%= @page[:post, :title] %>
tags: [post]
---
  h1#title = @page[:post. :title]
  span#date = @page[:post, :date]
  .post_content == yield

Partials

You may place partials in _include/.

/* _include/style.css.str */
#{
  if local[:red_text]
    '* {color: red}'
  end
}

body {
  background-color: #{local[:background_color]};
}

Standalone asciidoc

You can create standalone asciidoc pages (without a layout) using the standalone option.

---
# index.html.adoc
options:
  standalone: true
---
:linkcss:
:stylesdir: css

= My Website
---
# css/asciidoctor.css.erb
---
<%=
  require "asciidoctor"
  Asciidoctor::Stylesheets.instance.primary_stylesheet_data
%>

Front Matter

The YAML front matter has the be placed at the start of the file and surrounded by 2 lines containing 3 dashes (---). The following attributes are understood by Edward:

  • layout: Use a layout found in _layouts/. This attribute is not shared between files. See also Layouts.

  • options: Options to be passed to the templating engine. This attribute is not shared between files. See also [pipelines].

  • tags: For use in a few built-in helpers. See [tags].

All other attributes may be used freely.