From 96664355a8af1f131f9806c9375927abcd5bec36 Mon Sep 17 00:00:00 2001 From: Tiago Celestino <190265+tcelestino@users.noreply.github.com> Date: Wed, 30 Oct 2024 18:00:57 -0300 Subject: [PATCH] feat: 11yt settings (#53) --- .eleventy.js | 10 +++++++++- 404.html | 1 + index.njk => index.html | 6 +++--- package.json | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) rename index.njk => index.html (82%) diff --git a/.eleventy.js b/.eleventy.js index 7927572..f74df0b 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -2,6 +2,12 @@ const syntaxHighlight = require('@11ty/eleventy-plugin-syntaxhighlight'); module.exports = (eleventyConfig) => { eleventyConfig.addPassthroughCopy('assets'); + + eleventyConfig.addCollection('post', (collection) => { + // reversed all collections posts + return collection.getFilteredByGlob('posts/**/*.md').reverse(); + }); + eleventyConfig.addFilter('readableDate', (dateObj) => { const date = new Date(dateObj); date.setMinutes(date.getMinutes() + date.getTimezoneOffset()); @@ -11,13 +17,15 @@ module.exports = (eleventyConfig) => { year: 'numeric', }); }); + eleventyConfig.addPlugin(syntaxHighlight); + return { dir: { input: './', output: './_site', layouts: './_layouts', }, - templateFormats: ['html', 'liquid', 'md', 'njk'], + templateFormats: ['html', 'md'], }; }; diff --git a/404.html b/404.html index 3b4315e..419c102 100644 --- a/404.html +++ b/404.html @@ -1,4 +1,5 @@ --- +eleventyExcludeFromCollections: true title: Not Found permalink: 404.html layout: default diff --git a/index.njk b/index.html similarity index 82% rename from index.njk rename to index.html index 62516a2..62fdbe2 100644 --- a/index.njk +++ b/index.html @@ -1,16 +1,16 @@ --- layout: default --- -