Add future posts filter

This commit is contained in:
Erick Ruiz de Chavez 2021-02-08 07:47:17 -05:00
parent b49384088b
commit b43a7c439d

View file

@ -1,6 +1,6 @@
const pluginTailwindCSS = require("eleventy-plugin-tailwindcss");
const pluginRss = require("@11ty/eleventy-plugin-rss");
const cacheBuster = require('@mightyplow/eleventy-plugin-cache-buster');
const cacheBuster = require("@mightyplow/eleventy-plugin-cache-buster");
module.exports = function (eleventyConfig) {
eleventyConfig.addPassthroughCopy("_content/images");
@ -27,9 +27,12 @@ module.exports = function (eleventyConfig) {
month: "long",
});
const now = Date.now();
return collectionApi
.getFilteredByGlob("**/blog/*.md")
.reverse()
.filter((item) => item.date.getTime() <= now)
.reduce((agg, item) => {
const group = formatter.format(item.date);