No description
  • Ruby 71.6%
  • CSS 19.4%
  • Slim 6.6%
  • HTML 2.4%
Find a file
2026-02-10 15:05:16 +01:00
bin rename lib to src 2026-01-07 17:50:44 +01:00
homepage update readme a bit 2026-01-11 01:55:02 +01:00
src src/version.rb 0.5.0 2026-01-11 00:59:25 +01:00
.gitignore gitignore 2026-01-07 01:38:20 +01:00
.rubocop.yml strip extension only 2026-01-06 02:48:02 +01:00
Gemfile file index example 2026-01-04 21:56:29 +01:00
Gemfile.lock have a serve mode 2026-01-05 00:16:23 +01:00
mr-edward.gemspec update tilt 2026-01-09 19:56:29 +01:00
Rakefile rename lib to src 2026-01-07 17:50:44 +01:00
README.adoc match githubs sections ids in readme 2026-02-10 15:05:16 +01:00

Edward, a simple robust static site generator for Ruby

Edward is inspired by Jekyll (Edward Hyde is the name of Dr Jekylls 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.