-
Hi. Could you please help me set up a blog with Eleventy? The Goal
My attempt to achieve the goalPathnamesI added a {
"layout": "layouts/post.njk",
"permalink": "/blog/{{ page.fileSlug }}/"
} AssetsI added
I also added a pass-through copy rule for static assets:
ProblemsAs it turned out, I didn't quite think it through. The articles will get written to the build directory as follows:
The passthrough copy, of course, respects the original directory structure of source files; and since I modified the output path in the blog.json template, the output path for the articles is now different from the output path of associated assets. Questions
UPDATEAfter rummaging some more, I found this unresolved issue, which describes at least a part of my problem. So, there doesn't seem to be a decent solution, eh? 😞 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
Re: passthrough copy globbing, there might be an answer in https://www.11ty.dev/docs/copy/#advanced-options I haven't tried hacking that level in a long time, but rename: function(filePath) {
return filePath + '.orig';
}, So you might be able to parse the |
Beta Was this translation helpful? Give feedback.
Look on my Solutions, ye Mighty, and despair!
I ended up going with a custom filter solution since it seems like the filter is available in the
this.
scope when inside a directory data file. Seemed slightly more convenient than creating a ./helpers.js file that is imported in multiple files. 🤷eleventy.config.js