Page layout: default.hbs

Page src: test/fixtures/pages/yfm/variables.hbs

Page dest: test/actual/yfm/variables.html

Dest filename: variables.html

Dest basename: variables

Page title: YAML Variables



This is an example YAML variable. Variables need to be the first thing in the line. If it shows up in the result, it worked!

This would output the variable as literal text.

three: But this doesn't work. *DOOWB

And this would throw an error:

three: *DOOWB But this doesn't work.

YAML supports variables, or repeated nodes. The simplest explanation is that you define something as a variable by preceding it with "&NAME value" and you can refer to it with "*NAME" e.g.:

# YAML
some_thing: &NAME foobar
other_thing: *NAME

Parses to:

{"other_thing": "foobar", "some_thing": "foobar"}

Content


Page

Each pages

Debug Info


{
  "_page": "all",
  "assets": "../../assets",
  "basename": "variables",
  "data": {
    "title": "YAML Variables",
    "one": "This is an example YAML variable. Variables need to be the first thing in the line. If it shows up in the result, it worked!",
    "two": "This is an example YAML variable. Variables need to be the first thing in the line. If it shows up in the result, it worked!"
  },
  "dest": "test/actual/yfm/variables.html",
  "dirname": "test/actual/yfm",
  "ext": ".html",
  "extname": ".html",
  "filePair": {
    "src": [
      "test/fixtures/pages/yfm/associative-arrays.hbs",
      "test/fixtures/pages/yfm/block-literals.hbs",
      "test/fixtures/pages/yfm/comments.hbs",
      "test/fixtures/pages/yfm/data-files.hbs",
      "test/fixtures/pages/yfm/data-types.hbs",
      "test/fixtures/pages/yfm/document.hbs",
      "test/fixtures/pages/yfm/lists.hbs",
      "test/fixtures/pages/yfm/relational-trees.hbs",
      "test/fixtures/pages/yfm/underscore.hbs",
      "test/fixtures/pages/yfm/variables.hbs"
    ],
    "dest": "test/actual/yfm/",
    "orig": {
      "src": [
        "test/fixtures/pages/yfm/*.hbs"
      ],
      "dest": "test/actual/yfm/"
    }
  },
  "filename": "variables.html",
  "first": false,
  "index": 9,
  "isCurrentPage": false,
  "last": true,
  "middle": false,
  "number": 10,
  "one": "This is an example YAML variable. Variables need to be the first thing in the line. If it shows up in the result, it worked!",
  "page": "\n  \n  \n    \n    Layout filename: '{{layout}}'\n    \n    \n  \n  \n    
\n\n \n
\n
\n
\n

{{page.src}}{{page.dest}}

\n
\n
\n
\n\n {{pager pagination}}\n
\n\n
\n \n
\n
\n \n {{nav pagination}}\n
\n
\n \n
\n
\n
\n

Page layout: {{default originalLayout '(no layout defined)'}}

\n

Page src: {{page.src}}

\n

Page dest: {{page.dest}}

\n

Dest filename: {{page.filename}}

\n

Dest basename: {{page.basename}}

\n

Page title: {{default title '(no title defined)'}}

\n
\n\n
\n
\n
\n \n {{#if categories}}\n {{> collections-categories }}\n {{/if}}\n
\n
\n {{#if tags}}\n {{> collections-tags }}\n {{/if}}\n
\n
\n\n
\n\n \n
\n

{{{title}}}

\n
\n\n{{{two}}}\n\n{{#markdown}}\nThis would output the variable as literal text.\n``` yaml\nthree: But this doesn't work. *DOOWB\n```\nAnd this would throw an error:\n\n``` yaml\nthree: *DOOWB But this doesn't work.\n```\n\nYAML supports **variables**, or **repeated nodes**. The simplest explanation is that you define something as a variable by preceding it with \"&NAME value\" and you can refer to it with \"*NAME\" e.g.:\n\n``` yaml\n# YAML\nsome_thing: &NAME foobar\nother_thing: *NAME\n```\nParses to:\n``` json\n{\"other_thing\": \"foobar\", \"some_thing\": \"foobar\"}\n```\n{{/markdown}}\n\n
\n

Content

\n
\n \n\n
\n
\n\n

Page

\n \n

Each pages

\n \n\n

Debug Info

\n {{{inspect page 'json'}}}\n
\n
\n
\n
\n
\n \n \n\n", "pageName": "variables.html", "pagename": "variables.html", "prev": 8, "relativeLink": "variables.html", "src": "test/fixtures/pages/yfm/variables.hbs", "title": "YAML Variables", "two": "This is an example YAML variable. Variables need to be the first thing in the line. If it shows up in the result, it worked!" }