Skip to content

Commit a132381

Browse files
committed
23.1
[general] - automate eleventyNavigation (for good) - remove duplicated frontmatter - other minor changes and fixes [index] - add filters for projects lists - sort starred projects first - reduce image cycle interval
1 parent 67714fb commit a132381

34 files changed

Lines changed: 119 additions & 133 deletions

.eleventy.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,20 @@ const { buildTagWall, getRecents, getRelated, buildTimestamps } = require('./src
99
const addAsset = require('./src/static/js/building/linking.js');
1010
const { qka, quizButtons, quizQuestions } = require('./src/static/js/building/quizzing.js');
1111
const { buildVersionTag, buildKeywords } = require("./src/static/js/building/package.js");
12-
const projectImages = require("./src/static/js/building/images.js");
12+
const { projectImages, getFeaturedProjects, getMainProjects, getOtherProjects } = require("./src/static/js/building/projects.js");
1313

1414
module.exports = function (eleventyConfig) {
1515
eleventyConfig.addPlugin(EleventyRenderPlugin);
1616
eleventyConfig.addPlugin(eleventyNavigationPlugin);
1717

18+
eleventyConfig.addGlobalData("eleventyComputed", {
19+
eleventyNavigation: {
20+
key: data => data.eleventyNavigation.key || data.page.fileSlug,
21+
parent: data => data.eleventyNavigation.parent || data.page.parent,
22+
title: data => data.eleventyNavigation.title || data.title,
23+
}
24+
});
25+
1826
eleventyConfig.addPassthroughCopy("./src/static/js"); // css is compiled by sass
1927
eleventyConfig.addPassthroughCopy("./assets");
2028
eleventyConfig.addPassthroughCopy("**.json");
@@ -59,6 +67,10 @@ module.exports = function (eleventyConfig) {
5967
return text.slice(0, 160) + (text.length > 160 ? "..." : "");
6068
});
6169

70+
eleventyConfig.addFilter("featuredProjects", getFeaturedProjects);
71+
eleventyConfig.addFilter("mainProjects", getMainProjects);
72+
eleventyConfig.addFilter("otherProjects", getOtherProjects);
73+
6274
eleventyConfig.setLibrary("njk", new Nunjucks.Environment(
6375
new Nunjucks.FileSystemLoader("./"),
6476
{ lstripBlocks: true, trimBlocks: true }

package.json

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/404.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
title: 404
33
layout: generic.njk
44
permalink: /404.html
5-
eleventyNavigation:
6-
key: 404
75
---
86

97
couldn't find this page. are you sure it exists?
108

11-
[back to index](/)
9+
[back to index](/)
1210

1311
![](/assets/media/daft.gif)
1412

src/content/berkeley.njk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
layout: project.njk
33
title: berkeley
44
permalink: /berkeley/
5-
eleventyNavigation:
6-
key: berkeley
75
buttons: [
86
{icon: 'download', from: 'misc', url: '/assets/files/berkeley-mono-typeface.zip', text: 'regular'},
97
{icon: 'download', from: 'misc', url: '/assets/files/berkeley-mono-nerdfont.zip', text: 'patched'},

src/content/changelog.njk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
layout: project.njk
33
title: changelog
44
permalink: /changelog/
5-
eleventyNavigation:
6-
key: changelog
75
---
86

97
{% addStyle "changelog" %}

src/content/collections/projects/backup.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ emoji: 📚
1111
buttons: [
1212
{'url': 'https://drive.google.com/drive/folders/1z8Sc4v4nRte7a7H5TaDDtwROzoN4_Cu3?usp=share_link', 'icon': 'drive', 'text': 'drive'}
1313
]
14-
eleventyNavigation:
15-
key: backup
1614
---
1715

1816
{% addStyle 'backup' %}

src/content/collections/projects/til.njk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ desc: things I've asked myself over time and found the answer to.
55
subtitle: inspired by <a href="https://til.simonwillison.net/" target="_blank">Simon Willison's TIL</a>
66
icons: [eleventy, markdown, js]
77
permalink: /til/
8-
eleventyNavigation:
9-
key: til
108
---
119

1210
{% addStyle 'til' %}

src/content/collections/projects/webutils.njk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ desc: 'collection of various small utilities (converters, generators...)'
44
icons: [js]
55
permalink: /webutils/
66
emoji: 🖇️
7-
eleventyNavigation:
8-
key: webutils
97
---
108

119
<div class="carded" id="utils">

src/content/collections/quizzes/gti.njk

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,5 @@
22
title: gti quiz
33
desc: preguntas de socrative, examen y otras fuentes para Gestión de Tecnologías de la Información (ITIL4)
44
keywords: gti, quiz, test, daypo, epi, itil, itil4, examen, backup, backup carrera, epi gijon, epi gti, gti daypo epi
5-
eleventyNavigation:
6-
key: gti
7-
title: gti quiz
85
redirect_from: ["/quiz/gti", "/quizzes/gti"]
96
---
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
---
22
title: proyectos quiz
33
desc: preguntas de kahoot de proyectos
4-
eleventyNavigation:
5-
key: proyectos
6-
title: proyectos quiz
4+
redirect_from: ["/quiz/proyectos", "/quizzes/proyectos"]
75
---

0 commit comments

Comments
 (0)