Introduction

Ruhoh is a static blog generator. Ruhoh's technical goal is to be useful to all developers.

To accomplish this goal, we employ 3 core design principles:

  1. Ruhoh defines and adheres to the Universal Blog API for static blogging.
  2. Ruhoh relies on the cross-language Mustache templating system.
  3. Ruhoh is built using a modular architecture.

The Universal Blog API allows parsing modules, regardless of language, to reliably parse a ruhoh blog. Next we'll outline just how that processing works.

Design

Ruhoh's guiding design principle is modularization.
A modular architecture assumes an inherent level of customization in that modules can easily be extended or replaced to suit varying use-cases.

Additionally, clear, well-purposed modules written in one language allow for a general guideline when implementing the module in another language.

Application Flow

The following graphic illustrates the procedure implemented by the core modules to render your blog.

Description:

  1. Parsers extract the data from your blog directory for the Database to consume.
  2. Next a page is modeled from the database and its corresponding file.
  3. The templater and converter act on the page object transforming it to its fully rendered view.
  4. The page view can then be rendered in the browser via the Previewer or saved to disk using the Compiler.

Modules

Ruhoh modules are mostly concerned with extracting or processing data from your blog. The table below outlines the core modules and their primary roles.

Module Description
Parsers Parsers extract all data from your blog directory using the Universal Blog API.
Database The Database acts as the interface to the data returned from the parsers. Other modules should use the Database for interacting with data.
Note the database is nothing more than a class with accessors.
Page A Page processes and models the attributes expected from a Page object. Since other modules act on Page objects, the Page can be thought of as the most significant data model in Ruhoh.
Templater Templaters act on a page to expand its view into its fully rendered state. The default Ruhoh Templater is Mustache.
Converter Converters act on a page to parse its content body relative to a Markup language like Markdown.
Previewer The Previewer pragmatically loads a page based on URL and serves its rendered state to a web-server. This acts as the primary development environment.
Compiler The compiler iterates through every published page, saving the rendered states to disk, and porting over the current theme and media files.
The essence of static-blogging; you host the compiled version of your blog.
Client The command-line client exposes basic utility functions for automatically generating post and page files, as well as new blog and theme scaffolding.
The client is the primary interface for your day-to-day workflow.

Data

In Ruhoh everything is data. Most modules we've outlined are concerned only with extracting or processing data. We can simplify the concept of data into three Global data types:

Data Type Description
Page Data

  • Categories
  • Tags
  • Permalink
  • Date
  • Author
  • ...

The primary data structure in Ruhoh is the Page. Ultimately, your blog is just a set of ordered/organized pages.

Ruhoh has only one concept of a Page object, which is any file expecting to be processed. Strictly speaking, blog Posts in Ruhoh are just special types of pages. So any blog post your create, plus any normal pages like "about" or "homepage" are all considered Pages.

A Page contains requisite meta-data as outlined to the left, plus the page's main content body.

Template Data

  • Layouts
  • Partials

Templates act on Pages, expanding their full view to the final rendered output.

All pages may reference a layout of which it intends to render itself into. layouts may additionally reference another layout for which to render _itself_ into. This allows pages to have one sub-template and one master template.

Partials are blocks of arbitrary layout content, contained in files, that can be dynamically included into any page or layout.

Partials are especially useful when used in conjuction with a Templating Language.

Config Data

Configuration data is contained \_config.yml and outlines how your blog should be interpreted.

This is useful for specifying permalink format, comment engine provider, analytics, etc. You will also specify custom compiling and publishing parameters here.

Vision

Ruhoh's vision is to evolve the best and biggest technical blogging community in the world.

The design choices reflect this vision. At it's simplest, Ruhoh only does two things:

  1. Parses a directory to build a Data API.
  2. Uses the Data API to build web pages.

Ruhoh's technical goals:

Accomplishing the technical goals will help accomplish the main vision. The API can be free of any language dependency allowing users, regardless of language and/or platform, to join and evolve a common community.

I can sure use your help. =D

Join me on Ruhoh's GitHub Project Page