Storing frontmatter data under page variable #1717
Unanswered
benbrehaut
asked this question in
Q&A
Replies: 1 comment
-
You could use ---
title: "Normal title"
customVariable: 'Some custom variable'
eleventyComputed:
page:
title: "{{title}}"
customVariable: "{{ customVariable }}"
---
<p>title is {{ title }}</p>
<p>page.title is {{ page.title }}</p>
<p> customVariable is {{ page. customVariable }}</p> You are effectively saying set |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone 👋
Apologises if this has been answered somewhere.
I am looking at moving over a Jekyll site to use 11ty, which currently has about 450 pages.
On these pages, frontmatter is used for various information, which in Jekyll is stored under the
page.
variable:However, in 11ty, most of the defined frontmatter data is not stored in
page.
variable:Is there a way to adjust 11ty to store custom-defined frontmatter under the
page.
variable, so that instead of the current page object:I can have something more similar to how Jekyll current does it:
This is so to try and save potential changing 450 pages and to make the migration as smooth as possible. I understand if something like this isn't possible due limitations or such, but wanted to know if such a thing was possible!
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions