Open surjithctly opened 4 years ago
@surjithctly I'm sorry you encountered this on your first run with Eleventy. I'm not familiar with Nunjucks, but I'll still try to replicate your issue.
@binyamin My guess is its not depend on the nunjucks, so by following this format, you may try using any other language.
Thanks for the reply.
As a workaround, I'm now calling data from _data/*.json
Essentially, My question is: How to get *.md data inside an included partial in Eleventy?
Ah. Why can't you just {% import %}
it?
@binyamin can you show an example? Sorry, I'm new to this.
Not sure if you can just {% import %}
a raw markdown file into a liquid/markdown file (I imagine it would just output the raw Markdown and not parse it like you might expect). You might need to create some custom "markdown" filter.
https://github.com/11ty/eleventy/issues/658 should have some good tips (although not sure if it will work with includes of includes of blocks of layouts since there are lots of moving pieces here.
Do you have this in a public repo somewhere? I can try taking a look, but this is a lot of files and typing from screenshots.
@pdehaan I have created a minimal repo on Codesandbox. You will be able to see the issue yourself.
Link: https://codesandbox.io/s/eleventy-include-bug-s98jr
Problem: As you can see, I have rendeded header and footer in index by including it. But I cannot get data from header.md and footer.md
Hello All,
First time trying with 11ty.
Here's my problem:
I have home page called
index.njk
which usesdefault
layout. Inside default, I have includednavbar.njk
Now inside navbar, I have created ahero
block. And the hero block is overwritten byindex.njk
usinginclude hero.njk
I want content for
hero.njk
from a markdown file. But Its not working, I have added aheader.md
file and addedhero.njk
as layout but its not working. Its blank. Eleventy also not giving any error.So how do I add a markdown file. So I can
Call it in > hero.njk which is included in > index.njk which is using > default.njk where navbar is included > navbar.njk where hero block is defined
Screenshots for better understanding