-
-
Notifications
You must be signed in to change notification settings - Fork 496
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
Collect and parse external markdown files outside of dir.input
?
#204
Comments
You likely want to use data files. Have a look at the docs. I can't look it up right now because I'm not at a computer. |
Thanks @kleinfreund My use-case is a bit different, though. The example It seems that 11ty only parses markdown files if they exist within the I'm wondering if there's a way to get 11ty to read and parse external markdown files (outside of config Sounds like I may have to create a separate task that reads the markdown files and generates |
You should move the data you require to a location where Eleventy can work with it. Eleventy being able to touch anything outside of its root directory would be catastrophic. I certainly don’t want it to attempt building a static site out of my whole repo directory. Anyway, if you’re keen on having Eleventy process data from outside its directory, you can try working with JS data files and pull in the data with Node.js to set dynamic collections. |
Option 1Are you open to the idea of using If so, there are feature requests related to this: #61, #188 Option 2Are you only using front matter in these markdown files? If so, it sounds like you might be asking for the option to use If so, you could implement something yourself today (without waiting on our feature queue) using |
Thanks @zachleat I see value in both options above. I have another separate case where I'm going to take take a stab at implementing directly using js data files and gray-matter. Should be simple enough. I think allowing markdown as data files is also a great idea. Might be worth supporting |
@jevets note that when #61 is implemented you should be able to use a Directory specific data file (https://www.11ty.io/docs/data-template-dir/) to create a I personally think #61 has very high value at this point so it’ll probably be implemented soon. One more note: if you’d like additional data types to be supported in data files, please file a enhancement request so that it can go into the voting queue! Thanks! |
Not sure if 11ty can do this or if anyone has ideas on a better approach... or if it's a worthy use-case for 11ty.
I have a folder of markdown files that shouldn't be treated as templates; they don't map to resulting
.html
files. They do have frontmatter, though. I'd like to use them as collections within template files, parsed and ready to go.For example:
I'd like to be able to
So I could
Which builds to:
One idea is to use a separate task to parse the external markdown files and generate
.json
to be used as_data
, but 11ty can already parse markdown files and frontmatter; would be great to tap into that instead of having to reinvent.Another idea is to force them into the
dir.input
thenrm -rf
the resulting_site/colors
dir, but that seems just kinda wrong.The text was updated successfully, but these errors were encountered: