From 12fd0de018bd2b116b623a54de84a91276568ad3 Mon Sep 17 00:00:00 2001 From: Tiago Celestino Date: Wed, 30 Oct 2024 17:57:33 -0300 Subject: [PATCH 1/5] chore: rename folder --- index.njk => index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename index.njk => index.html (73%) diff --git a/index.njk b/index.html similarity index 73% rename from index.njk rename to index.html index 62516a2..0e3fe49 100644 --- a/index.njk +++ b/index.html @@ -1,16 +1,16 @@ --- layout: default --- -
-
Anotações para mim mesmo, mas se tiver interesse em ler, fique a vontade.
+
Anotações para mim mesmo, mas se tivers interesse em ler, fique a vontade.
    - {%- for post in collections.post | reverse -%} + {%- for post in collections.post -%}
  1. - {{ post.data.title | safe }} + {{ post.data.title | raw }}

  2. {%- endfor -%}
+
From cab6fbeb0dfa226082dd59e89817a61511653b40 Mon Sep 17 00:00:00 2001 From: Tiago Celestino Date: Wed, 30 Oct 2024 17:58:13 -0300 Subject: [PATCH 2/5] feat: settings to use .html files instead .njk --- .eleventy.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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'], }; }; From fba0fc5c96d8e424114602db5080144e41eed66e Mon Sep 17 00:00:00 2001 From: Tiago Celestino Date: Wed, 30 Oct 2024 17:58:43 -0300 Subject: [PATCH 3/5] feat: remove template collections --- 404.html | 1 + 1 file changed, 1 insertion(+) 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 From f550ec658ea34be3c0a522bf4117da3bb836dad3 Mon Sep 17 00:00:00 2001 From: Tiago Celestino Date: Wed, 30 Oct 2024 17:59:03 -0300 Subject: [PATCH 4/5] build: clean folder in dev process --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ff71478..a4a4006 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "scripts": { "clean": "rm -rf ./_site", "build": "npm run clean && eleventy --pathprefix=bloco-de-notas", - "dev": "DEBUG=Eleventy* eleventy --serve --watch", + "dev": "yarn clean && DEBUG=Eleventy* eleventy --serve --watch", "start": "eleventy --serve --watch" }, "repository": { From ee5a27414d008a3eacc4e266c92b5b3f810ab01e Mon Sep 17 00:00:00 2001 From: Tiago Celestino Date: Wed, 30 Oct 2024 17:59:57 -0300 Subject: [PATCH 5/5] chore: typo --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 0e3fe49..62fdbe2 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ layout: default ---
-
Anotações para mim mesmo, mas se tivers interesse em ler, fique a vontade.
+
Anotações para mim mesmo, mas se tiver interesse em ler, fique a vontade.
    {%- for post in collections.post -%}