Quiero crear colecciones dinámicamente en 11ty.js y para eso tengo un bloque de código así
eleventyConfig.addCollection("myGithub", (collection) => { const result = collection.getAll()[0].data.myGithub const tags = collection.getAll()[0].data.myGithub.tags tags.forEach(tag => { console.log('hello') eleventyConfig.addCollection(`tag${tag}`, (collection) => { const repos = collection.getAll()[0].data.myGithub.repos console.log('hello') return repos.filter(repo => { return repo.data.tags.includes(tag) }) }) }); console.log(Object.keys(collection.getAll()[0].data.collections)) return result }) pero esto parece omitir el eleventyConfig.addCollection interno ya que no veo esas declaraciones de console.log , y me pregunto si algo en 11ty me impide hacer esto. si no, que estoy haciendo mal?
no siempre, pero a veces también recibo un error como
UserConfigError: config.addCollection(HTML) already exists. Try a different name for your collection.