App-Dapper

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

      date: 2015-08-01T10:00:00
      urlpattern: /:year/:month/:slug.html
      ---

  is written to `_output/2015/08/foo-bar-baz.html`, and `page.url` is
  `/2015/08/foo-bar-baz.html`. All other pages keep the path of their
  source file (`_source/about/index.md` becomes `_output/about/index.html`
  with a `page.url` of `/about/`).

* `categories: blog` puts the page in `site.categories.blog`. A list
  (`categories: [news, blog]`) puts it in each; the first is used for
  `:category`.

* `date: 2014-05-02T10:30:00` sets the page's date. ISO 8601 date-times
  (optionally with a time zone, e.g. `2014-05-02T10:30:00-05:00`), the
  older `2014-05-02 10:30:00` format and plain dates (`2014-05-02`) are
  accepted. Without a `date`, the file's modification time is used.

* `layout: post` selects `_layout/post.html`. Without a `layout`,
  `_layout/index.html` is used.

* `template: true` runs the page's content as template code; see
  [Template code in content](#template-code-in-content).

* `tags: [perl, writing]` puts the page in `site.tags.perl` and
  `site.tags.writing`.

* `description`, `image` and `author` are used by `page.seo`, the feed
  and `llms.txt`. Without a `description`, the excerpt is used.

* `updated: 2014-06-01` is when the page last changed, for the sitemap,
  the feed and `page.seo`.

* `paginate` lists posts across several pages; see
  [Pagination](#pagination).

* `markdown_twin: false`, `llms: false` and `sitemap: false` leave the
  page out of the Markdown copies, `llms.txt` and the sitemap.

Here is an example that shows a few different types of YAML definitions
at the beginning of a source file and how to use those definitions in
templates.

```
---
name: My Site
menu:
    Home: /
    Portfolio: /portfolio/
    About: /about/
    Github: http://github.com/markdbenson
fruits:
    - Apple
    - Orange
    - Banana
---

<h2>Name</h2>
[% page.name %]<br />

<h2>Menu</h2>
<ul>
[% for link in page.menu %]
    <li><a href="[% link.value %]">[% link.key %]</a></li>
[% end %]
</ul>

<h2>Fruits</h2>
<ul>
[% for fruit in page.fruits %]
    <li>[% fruit %]</li>
[% end %]
</ul>
```

Front matter values are always available to layouts as `page.*`. To use
template directives in a page's own content, as in the example above, the
page needs `template: true` (see [Template code in
content](#template-code-in-content)). Only do that for content you trust,
especially with `EVAL_PERL` enabled (see [Perl code](#perl-code)). More information is available in [Appendix C:
Internals](#appendix-c-internals).

Dapper depends on
[MultiMarkdown](http://fletcherpenney.net/multimarkdown/). Or, more
specifically, the Perl module implementation of MultiMarkdown ([Text::
MultiMarkdown](https://metacpan.org/pod/Text::MultiMarkdown).

MultiMarkdown is based on the traditional definition of Markdown by
John Gruber of [Daring Fireball](http://daringfireball.net), but adds
additional nice features such as tables and footnotes.

The following sections describe the markup that Dapper accepts, including
headings, text, lists, footnotes, tables, and images. There are more
features of the MultiMarkdown engine that Dapper uses. See the
[MultiMarkdown documentation](http://fletcher.github.io/MultiMarkdown-4/)
on CPAN for details.

## Template code in content

Layouts are always processed as templates. A page's own content is not:
`[% ... %]` in a page is shown as it is, so you can write about template
code, or publish text from anywhere, without it running.

A page whose content should be processed as a template (a list of posts,
say) opts in with `template: true`:

    ---
    title: Home
    template: true
    ---
    [% FOR post IN site.categories.blog.reverse %]
    <a href="[% post.url %]">[% post.title | html %]</a>
    [% END %]

`templates_in_content: true` in `_config.yml` makes every page's content,
and every value in `_config.yml`, a template, as they were before Dapper
1.0. Use it for sites written for older versions; see [Upgrading to
1.0](#upgrading-to-10).

## Front matter schemas



( run in 1.260 second using v1.01-cache-2.11-cpan-60884a8df76 )