-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/demo updates #10
base: forestry
Are you sure you want to change the base?
Conversation
✔️ Deploy Preview for juancarlosasensio ready! 🔨 Explore the source changes: 68945e2 🔍 Inspect the deploy log: https://app.netlify.com/sites/juancarlosasensio/deploys/61ffea37098c3900085383da 😎 Browse the preview: https://deploy-preview-10--juancarlosasensio.netlify.app |
…display content-updates.
{% for item in currentDemoContentUpdates | reverse %} | ||
<li> | ||
{# This line ↓↓ returns the HTML output (what .md files are compiled into) EXACTLY the way we want it!! ↓↓ #} | ||
{{ item.templateContent | truncate(100) | safe }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is key. 🔑
Figuring this out gave me a lot of trouble while working on this feature.
@@ -1,23 +1,25 @@ | |||
--- | |||
title: 'Demos' | |||
layout: '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Override the layout property that comes from demos/demos/json
.
The goal is to allow for updates to be rendered for any piece of content, starting with any markdown file that's part of a collection like
posts
ordemos
There are a number of ways to go about this. One route that we've been testing with involves using filters to find content updates from the default 11ty collections that match the title of a given piece of content.
Another idea is to create a json file that we can consume on build. We would then use something like eleventyComputed or another way to call a JavaScript function or access a JavaScript data file to get the content update that match a particular piece of content.
Super helpful links on how to get only the content from a file and how to work with data
Some TODO ideas:
renderFile
orrenderTemplate
shortcodes.page.excerpt
? https://www.11ty.dev/docs/data-frontmatter-customize/#example-parse-excerpts-from-contentWorking with Front Matter