Replies: 1 comment 7 replies
-
@ahillio If you're using Eleventy v1.0.0+, I'd suggest using the EleventyRenderPlugin plugin (specifically the <!-- ./src/_includes/content.md -->
## I am some content
I am a paragraph
- i am
- a list
> blockquote ---
# src/index.liquid
title: "11ty-2289"
---
<h1>{{ title }}</h1>
{% renderFile "./src/_includes/content.md" %}
<footer>
<p>© 2099</p>
</footer> // .eleventy.js
const { EleventyRenderPlugin } = require("@11ty/eleventy");
module.exports = (eleventyConfig) => {
eleventyConfig.addPlugin(EleventyRenderPlugin);
return {
dir: {
input: "src",
output: "www",
}
};
}; OUTPUT<!-- ./src/_includes/content.md -->
<h2>I am some content</h2>
<p>I am a paragraph</p>
<ul>
<li>i am</li>
<li>a list</li>
</ul>
<blockquote>
<p>blockquote</p>
</blockquote> |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a liquid template for displaying a collection. I want to do
{% include content.md %}
but can't find any solutions. I would absolutely settle for having to{% include content_layout.liquid %}
and use thatcontent_layout.liquid
file to render mycontent.md
file... or any other way to do this ...but I've tried that and the markdown content file does not get displayed.This seems like it would be a fairly common thing to do, have a piece of content at the top of your collection and be able to edit that content in a markdown file instead of html inside the template.
Are there any blogs or docs which explain this? I've checked and websearched and the only thing I found was on stackoverflow saying "11ty doesn't work that way" :(
Beta Was this translation helpful? Give feedback.
All reactions