Ream

Home - Get Ream - Learn - Why? - Links and Inspiration

Learn

CLI Reference

Text Formatting Specifications

Pages and posts are expected to be HTML snippets with a two-line header:

  1. Title
  2. Author

The HTML content starts on the third line and is the rest of the file.

The <!--SHORT-BREAK--> token provided exactly as-is on its own line can be used to demarcate the boundary between the "short" text and the rest of a post. The short text will be used as the description for the post in RSS. If this token is missing then the entire contents of the post will be used.

Snippets

Snippets are HTML fragments that live in the snippets/ directory. They are referenced by their name minus the .html extension. Snippets can contain templates, but extra care must be taken not to create infinite loops. Ream will abort processing with an error if nesting exceeds 10 levels.

Snippets are great to use when you want to share some HTML content in all three of the page templates (home, page, and post); e.g. a header, a footer, or a link tree.

File Structure

A site is expected to be a folder containing:

Page/Post

Pages are expected to be in subdirectories directly inside the pages/ directory.

Posts are expected to be in a directory hierarchy that looks like posts/<year>/<month>/<day>. Only a single post per day is supported. Month and day are expected to be two-digit numbers (i.e. leading zeroes).

Pages and posts will have the first path component (either pages/ or posts/) removed when output to help beautify the generated URL. For this reason you should avoid naming pages archive or a four-digit year that conflicts with the generated posts.

Site Generation Notes

Any additional files inside of the post and pages structure will be copied wholesale to the corresponding location in the built site. This allows you to add images or other files specific to a post or page directly adjacent to the index.html and easily reference them rather than putting them into the files/ subdirectory.

When a site contains posts, an archive page and a feed.xml RSS feed will be created at the root of the site.

Config

The required keys are:

Feel free to define your own key-value pairs. They can be accessed through text templates (see below). The values can even contain more templates, though be careful about the maximum nesting constraint — templates currently support 10 levels of nesting.

Template Reference

Parameterized templates in Ream can be nested, mostly to allow using CFG templates to centralize settings. There's also nothing particularly “hygenic” about them as they're implemented using basic text replacement.