-
-
Save w00fz/1b18d22dd77b28baa66ec835becb5ee5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% set items = [] %} | |
{% for child in page.collection() %} | |
{% set items = items|merge([{ frontmatter: child.header, content: child.content} ]) %} | |
{% endfor %} | |
{% set payload = { | |
name: page.header.title, | |
route: page.route, | |
type: page.template, | |
items: items, | |
content: { | |
body: page.content | |
} | |
} %} | |
{{ payload|json_encode|raw }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Home", | |
"route": "/", | |
"type": "home", | |
"items": [ | |
{"frontmatter": {"title": "Foobar"}, "content": ""}, | |
{"frontmatter": {"title": "Foobar"}, "content": ""}, | |
{"frontmatter": {"title": "Title 1"}, "content": ""}, | |
{"frontmatter": {"title": "Title 2"}, "content": ""} | |
], | |
"content": { | |
"body": "<p>Content stuff here</p>" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment