Replies: 2 comments 1 reply
-
I managed to get it to work but it's gross. Perhaps there's a cleaner way to delegate the front matter?
My clue came from here: #576 (comment) |
Beta Was this translation helpful? Give feedback.
0 replies
-
Why use the
I'd just use this: (N.B.: I use Similarly, I'd just use something like this for content:
If I've misunderstood the problem, let me know. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm making a very simple news article system where each article is in
/articles/article-*.md
. Articles are rendered with a templatearticle.html
and the template loops some front matter in each article (a selection of images) and outputs them before the main markdown content is inserted.This all works well and is straightforward. Unfortunately however I've really hit up against a wall when trying to make
/index.html
render the latest article (as in the last article in the collection).I can grab the latest article via
collections.article | last
and outputarticle.templateContent
but this only outputs the markdown and doesn't take into account the template. I've tried addinglayout: article.html
as front matter on/index.html
but to no avail. It tries to render with the template but doesn't find the variables it needs (e.g. theimages
array that would have come from the front matter in the article.I'm hoping I've missed something obvious. I've tried using
eleventyComputed
to pre-compute the latest article but no dice.Beta Was this translation helpful? Give feedback.
All reactions