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.:
{
"_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{{{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 \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!"
}