{collection 'blog'} turns the Markdown files of _content/blog/ into rows - a small flat-file CMS. Each .md file is one occurrence: the keys of its front matter (YAML between two --- lines) are its fields, and three more are added: slug (the file name without .md), body (the Markdown written as HTML by the {markdown} renderer) and source (the Markdown text as it was).

The body is HTML, so print it raw with {!body} - {$body} would escape it. Raw HTML written in the Markdown itself is escaped unless the tag has the html option, which is meant for files the site's own authors write.

The rows come in file name order; every handling option works on them - sort='date DESC', first=10, where='$draft ne 1', page= with a {pager}. For the page that shows one post, slug=$slug reads that file alone; a slug that names no file gives no rows, so the @else@ branch can say "not found".

The directory is looked up like a _data file: the page's own directory, then each parent up to the application root, then the _common application. A collection without a name, or one that has no directory, is an error under the strict check. From PHP, padCollection ( 'blog' ) gives the same rows.