diff --git a/.eleventy.js b/.eleventy.js index d2a4693..873c6c2 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,5 +1,7 @@ module.exports = function(eleventyConfig) { + const postLayouts = [ 'post', 'link', 'quote', 'gallery', 'status' ]; + eleventyConfig.addLayoutAlias('gallery', 'layouts/gallery.njk'); eleventyConfig.addLayoutAlias('link', 'layouts/link.njk'); eleventyConfig.addLayoutAlias('page', 'layouts/page.njk'); @@ -9,6 +11,13 @@ module.exports = function(eleventyConfig) { eleventyConfig.setUseGitIgnore(false); + eleventyConfig.addCollection('postsCollection', function(collection) { + const tmpCollection = collection.getAllSorted(); + return tmpCollection.reverse().filter(function(tpl) { + if ( tpl.data.permalink && postLayouts.includes(tpl.data.layout) ) return tpl; + }); + }); + return { dir: { input: "content", diff --git a/content/_includes/layouts/all.njk b/content/_includes/layouts/all.njk index 7a8466b..d4ec363 100644 --- a/content/_includes/layouts/all.njk +++ b/content/_includes/layouts/all.njk @@ -4,15 +4,14 @@
{{ content | safe }}