AE
const collections = ['work', 'education']
collections.forEach((name) => {
config.addCollection(name, function (collection) {
const folderRegex = new RegExp(`\/${name}\/`)
const inEntryFolder = (item) =>
item.inputPath.match(folderRegex) !== null
const byStartDate = (a, b) => {
if (a.data.start && b.data.start) {
return a.data.start - b.data.start
}
return 0
}
return collection
.getAllSorted()
.filter(inEntryFolder)
.sort(byStartDate)
})
})
Получается он ищет папку по названию, но мне надо их переложить в папки с языковыми префиксами, типо такого: eleventyConfig.addCollection("posts_en", function (collection) {
return collection.getFilteredByGlob("./src/en/posts/*.md");
});
eleventyConfig.addCollection("posts_fr", function (collection) {
return collection.getFilteredByGlob("./src/fr/posts/*.md");
});