static-ish - plain-text content & blogging engine for PHP



Loads a page from $path, returning the page object
Returns page metadata item (as defined by the YAML preamable) identified by $key
$page->__set($key, $val)
Sets page metadata item identified by $key to $value
$page->block_html($options = array())
Returns HTML representation of page's blocks, concatenated into a single string
foreach ($page as $block)
Iterates over each page block


static-ish's Blog class is a wrapper around a directory structure arranged according to a simple convention, permitting content to be accessed and queried as a blog.

Example static-ish blog directory structure:
  |- # Blog metadata contained in YAML preamble
  |- 2008
  |  |- 01
  |  |  |-
  |  |  |-
  |  |
  |  |- 05
  |  |- 10
  |  |- 23
  |- 2009
     |- 05
     |- 07

Note: leading zeroes for months are required.

At the very least, should define base_url, the URL prefix for all blog posts (a post's full URL can be retrieved using $post->url). Additionally, if present, the keys title, description, language and copyright will be inserted into the RSS feed.

new Blog($blog_root, $host = '')
Creates a new Blog instance, with content root $blog_root and (optional) hostname $host. $host will be prepended to all URLs generated by the blog engine, before base_url as defined in the blog's
Returns a Page containing the blog's metadata.
Returns a specified post from the blog. Format of $path should resemble 2009/01/foo-bar-baz, or more formally, match the regex |^\d{4}/\d{2}/[a-z0-9\._-]+$|i. When searching for a matching file, the engine will ignore any numeric prefix on the page's name. For example, post path 2009/01/foo would match both 2009/01/ and 2009/01/ This allows you to organise monthly folders chronologically without causing the day numbers to appear in URLs.
$blog->get_page($page, $rpp)
Returns the $pageth page of posts based on $rpp posts per page.
Returns an array mapping month (expressed as Unix timestamp) => number of posts.
Returns the total number of posts in the blog.
Returns the total number of pages in the blog, based on $rpp posts per page.
Returns an array of posts for the given month, expressed as a Unix timestamp.
$blog->get_monthly_archive($year, $month)
Returns an array of posts for the given year and month.
Returns a DOMDocument representing an RSS feed of the latest $count posts.