-
I use parcel at work all the time to deliver a very important mission critical static application every day, and for that I am truly thankful. However, I have another potential use case that is giving me trouble, and I'm having trouble understanding how to use plugins properly for my needs. Let's say I have the following file structure in my static site, and use the following command. npx parcel src/**/*.* This is the file layout.
I would like to produce an HTML asset for each markdown file (and also each ejs file that doesn't start with an "_".) When the md file is rendered, I want to use the _layout.ejs file in the directory of the markdown, and then nest that rendered content into each parent directory's layout file. Given the following layout:
The following things would happen:
Of course, the HTML files would then function like normal. Does anyone have any suggestions on how to achieve this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
What you need is something like https://github.com/mischnic/parcel-ssg If you really only need "dumb" templating, then you really only need a transformer that converts markdown to HTML (and respects the layout files in parent folders). If you need more of the features usually provided by e.g. Eleventy ("global" information like generating a navbar with list of pages, RSS feed), then it becomes more complicated |
Beta Was this translation helpful? Give feedback.
parcel build 'src/**/*.md'
Does that answer your questions?