Skip to content

Commit

Permalink
Closes #72
Browse files Browse the repository at this point in the history
  • Loading branch information
xplosionmind committed Jan 24, 2023
1 parent bcea8ca commit fd767cd
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 30 deletions.
11 changes: 7 additions & 4 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function wikilinkSlugifier(pageName) {
return pageName
}
const markdownIt = require('markdown-it');
const { default: slugify } = require('slugify');
const md = markdownIt({
html: true
})
Expand All @@ -37,11 +38,13 @@ const md = markdownIt({
module.exports = function(eleventyConfig) {
// General //
eleventyConfig.setLibrary('md', md);
eleventyConfig.setFrontMatterParsingOptions({
permalink: '/{{ page.fileSlug }}/',
});
eleventyConfig.addDataExtension('csv', contents => require('csv-parse/sync').parse(contents, {columns: true, skip_empty_lines: true}));
eleventyConfig.setFrontMatterParsingOptions({ excerpt: true, excerpt_separator: '<!--excerpt-->'});

eleventyConfig.addGlobalData('permalink', () => {
return (data) => slugify(`${data.page.fileSlug}`, {
lower: true
}).concat('/');
});

// Collections //
eleventyConfig.addCollection('posts', function(collection) {
Expand Down
21 changes: 2 additions & 19 deletions content/content.11tydata.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
const {titleCase} = require('title-case');
const wikilinkRegExp = /\[\[\s?([^\[\]\|\n\r]+)(\|[^\[\]\|\n\r]+)?\s?\]\]/g // This regex finds all wikilinks in a string
const {titleCase} = require('title-case');
function caselessCompare(a, b) {
return a.toLowerCase() === b.toLowerCase();
}

module.exports = {
permalink: '/{{ page.fileSlug | downcase | replace: " ", "-" }}/',
lang: 'en',
layout: 'wrapper.html',
image: '/tommi.space.wip.png',
image: '/tommi.space.wip.webp',
// Automatically generating titles, as explained in https://github.com/11ty/eleventy/discussions/2241#discussioncomment-2224265
eleventyComputed: {
title(data) {
Expand All @@ -21,22 +20,6 @@ module.exports = {
// console.log(`${data.page.filePathStem} => ${title}${hadTitle ? " (had title)" : ""}`);
return title;
},
/*date(data) {
let hadDate = false;
const date = data.date || '2020-03-20';
if (data.date) {
hadDate = true;
}
return date;
},*/
/*updated(data) { // disabled since always having an updated date is useless
let hadUpdated = false;
const updated = data.updated || data.date;
if (data.updated) {
hadUpdated = true;
}
return updated;
},*/
sitemap: {
img: data => {
return { url: data.image };
Expand Down
4 changes: 2 additions & 2 deletions content/newsletter-addio.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ lang: it
eleventyExcludeFromCollections: true
sitemap:
changefreq: never
prioriry: 0.1
prioriry: 0.1
---
Eh già, lo so. Posso diventare estenuante e logorroico, mi dispiace.
Ti sei disiscritto con successo (sob) alla mia pseudo-newsletter.

Addio, o forse arrivederci.

Clicca in qualunque punto per tornare alla home.
Clicca in qualunque punto per tornare alla home.
4 changes: 2 additions & 2 deletions content/newsletter-iscrittə.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ eleventyExcludeFromCollections: true
lang: it
sitemap:
changefreq: never
prioriry: 0.1
prioriry: 0.1
---
Ti sei iscrittə con successo a <cite>Parole Sconnesse</cite>, la pseudo-newsletter di Tommi. Grazie!
Clicca in qualunque punto per tornare alla home.
Clicca in qualunque punto per tornare alla home.
4 changes: 2 additions & 2 deletions content/notes/public/Se la vita che salvi è la tua.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
date: 2022-01-18T09:33:21+01:00
updated: 2022-01-19T10:00:55+01:00
updated: 2023-01-24T22:30:02+01:00
tags:
- reading/book
redirect_from: [/se-la-vita-che-salvi-e-la-tua/,/se-la-vita-che-salvi/,/geda-vita/,/vita-che-salvi/]
redirect_from: [/se-la-vita-che-salvi/,/geda-vita/,/vita-che-salvi/]
description: |
Estratti e pensieri da <a href='https://openlibrary.org/works/OL23116226W/Se_la_vita_che_salvi_%C3%A8_la_tua' target='_blank' title='“Se la vita che salvi è la tua„ su Open Library'>Se la vita che salvi è la tu</a> di <a href='https://it.wikipedia.org/wiki/Fabio_Geda' target='_blank' title='Fabio Geda su Wikipedia'>Fabio Geda</a>
toc: false
Expand Down
2 changes: 1 addition & 1 deletion content/posts/2020-12-12-Non-so-più-leggere.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Non so più leggere
date: 2020-12-12
image: /2020-12-12-non-so-piu-leggere.jpg
redirect_from: ['/analfabetismo/', '/non-so-leggere/', '/non-so-piu-leggere/']
redirect_from: ['/analfabetismo/', '/non-so-leggere/']
---
Le lettere, le parole mi scorrono davanti senza lasciare un segno. È tutto uguale, lontano, criptico, inafferrabile. Come se ciò che leggo apparisse in una lingua diversa da quella che il mio cervello sa decodificare.

Expand Down

0 comments on commit fd767cd

Please sign in to comment.