Skip to content
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

Open
wants to merge 5 commits into
base: forestry
Choose a base branch
from
Open

Conversation

juancarlosasensio
Copy link
Contributor

@juancarlosasensio juancarlosasensio commented Jan 31, 2022

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 or demos

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:

Working with Front Matter

@netlify
Copy link

netlify bot commented Jan 31, 2022

✔️ 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

{% 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 }}
Copy link
Contributor Author

@juancarlosasensio juancarlosasensio Feb 6, 2022

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: ''
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant