Given an input of:
README.md
- dir1/
- README.md
- anotherfile.md
- dir2/
- README.md
is there a GLOBAL option that I can use to have README.md files output as index.html?
THE HUGE CATCHES are:
readme.11tydata.js in the same directory as the markdown files.Is this possible?
Example: https://github.com/springernature/diversity-hiring. I'd like the root to be cleared of the data file (and .eleventyignore if it's possible to configure that away also)
LOOK AT THIS LOVELY BOY AND HIS SOLUTION!: https://twitter.com/zachleat/status/1298641013968437251
I should be able to use eleventyComputed.js to transform the page.inputPath value.
馃榿
an alternative solution, right in the eleventy file:
eleventyConfig.addCollection('readme', collection => {
return collection.getAllSorted().map(item => {
if (item.fileSlug === 'README') {
item.outputPath = item.outputPath.replace('/README', '');
}
});
});
output:
Writing _site/index.html from ./src/README.md.
Writing _site/dir2/index.html from ./src/dir2/README.md.
Writing _site/dir1/anotherFile/index.html from ./src/dir1/anotherFile.md.
Writing _site/dir1/index.html from ./src/dir1/README.md.
Wrote 4 files in 0.21 seconds (v0.11.0)
I ended up using @vfalconi's solution. Thanks for the help, folks!
Most helpful comment
an alternative solution, right in the eleventy file:
output: