Skip to content

Latest commit

 

History

History
15 lines (13 loc) · 425 Bytes

debug-11ty.md

File metadata and controls

15 lines (13 loc) · 425 Bytes

Debug 11ty

Print all collections (= output in Nunjucks {%- for pages in collections.all %} )

eleventyConfig.addCollection("debugMyContent", function(collectionApi) {
  const cleaned = collectionApi.getAll().map(coll => ({
    // edit here to print just some values
    path: coll.template.inputPath,
    title: coll.data.title,
  }))
  console.log('cleaned *** ', cleaned)
  return collectionApi.getAll()
});