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

YAML Preamble

Each page may begin with a YAML-formatted preamble block, providing metadata about the page itself.

title: Page title
published_at: 2009-12-11T16:00:00
author: Mr. Smith
tags: ["foo", "bar", "baz"]

All fields are optional, but type is special - if present, Page::load() will use its value as the class to instantiate, instead of the default Page. If published_at is not present it will be set to the page's modification time, as reported by filemtime().

HTML Blocks

HTML blocks simply return their original content, unaltered.

--- html

<p>This is content inside an HTML block</p>

Markdown Blocks

Block content is converted to HTML using Markdown.

--- markdown

Heading
=======

Here is some content marked down, not up.

Textile Blocks

Block content is converted to HTML using Textile.

--- textile

h1. Heading

Lorem ipsum dolor sit amet, consectetur adipisicing elit.

Code Blocks

Code blocks convert their content to syntax-highlighted HTML using the GeSHi library, and accept the following arguments:

language (required) The source code's language - corresponds directly to name of GeSHi language file
caption (optional) Caption to display above highlighted code
start (optional) Number of first line
highlight (optional) Comma-separated list of line-numbers to highlight
--- code language: php caption: "How to iterate"

<?php
foreach ($foo as $k => $v) {
  echo $k . " = " . $v . "<br />";
}
?>

Before rendering the highlighted text, code blocks will call the global function staticish_configure_geshi if it exists, passing the GeSHi instance as the sole argument. Use this hook to perform any custom configuration of the GeSHi highlighter.

Youtube Blocks

For embedding videos from Youtube. Supported arguments:

id (required) Video ID as extracted from the Youtube URL. E.g. for the URL 'http://www.youtube.com/watch?v=A08D4l8pUzE', video ID is 'A08D4l8pUzE'
size (optional) One of 'small', 'medium', 'large' or 'x-large'
start (optional) Start time, expressed as minutes/seconds, e.g. '0m30s'
--- youtube id: A08D4l8pUzE size: small start: 1m30s

Page-break Blocks

Page-break blocks have no HTML representation but are useful for truncating content and displaying "read more" links.

--- pagebreak