Tutorials /

How to access post content in template listing files

Nov 6, 2022 • 🍿 1 min. read

Why do this?

You might want to show the contents of posts in listings, like a social feed for example.

Solution:

In your eleventy template listing you can use

{{ entry.templateContent | safe }}

(with entry being whatever the post object name you are iterating on) which gets the contents of the post (markdown in my case), escapes it and makes it safe for use in the listing.


Was this useful? →

← Back to Tutorials