How to form the title of a page using data from a data file #4277
Answered
by
sentience
ironfish1000
asked this question in
Q&A
|
If I have a data file eg data.json containing: and have a file index.md in the same folder, I know I can get eg But if I use this in front matter, eg: Then 11ty throws an error. Is there any way for me to get data into front matter? Thanks ahead of time for any help. |
Answered by
sentience
May 22, 2026
Replies: 1 comment 1 reply
|
I believe what you're looking for is ---
eleventyComputed:
title: "This city has a population of {{ population }}"
--- |
1 reply
Answer selected by
ironfish1000
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I believe what you're looking for is
eleventyComputed: https://www.11ty.dev/docs/data-computed/#using-a-template-string