Chopin
Generate a static web site using a combination of ERb templates, Markdown, and SASS/SCSS.
Installation
gem install chopin
How to use
chopin <source-directory> <destination-directory>
There are six rules to determine what Chopin does with each file in the source directory:
- A file beginning with
.
is ignored. - A file named
layout.erb
is used as a template for sibling and child directories. - Any
.erb
or.md
file is parsed and rendered inside the closestlayout.erb
template, ascontent
binding (<%= content %>
). - Any
.sass
or.scss
file that does not begin with_
is converted into CSS - A directory is copied over to the destination, then its contents are parsed recursively.
- Any other file is copied over as-is.
In addition to the content
variable, a bound variable of page_name
is also passed down into the context of the layout.erb
for each page. This value is an assembled string based on the relative path of the page content's file. For example, a content file sub/index.md
would have a page_name
value of "sub-index"
.