From 5a3ce74518b302000e2a807304a73ec9c08c9c29 Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Mon, 1 Jan 2024 18:54:55 -0800 Subject: [PATCH] chore: prune unused filters --- config/filters/index.js | 23 +---------------------- src/social-preview.liquid | 2 +- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/config/filters/index.js b/config/filters/index.js index cfeb738a..e197bda3 100644 --- a/config/filters/index.js +++ b/config/filters/index.js @@ -20,7 +20,7 @@ export default { const replacement = '&' return string.replace(pattern, replacement) }, - splitlines: (input, maxCharLength) => { + splitLines: (input, maxCharLength) => { const parts = input.split(' ') const lines = parts.reduce(function (acc, cur) { if (!acc.length) return [cur] @@ -126,27 +126,6 @@ export default { }) .split(',')[0] }, - toDateTime: (date) => { - const formatted = DateTime.fromISO(date) - const trail = (number) => { - return parseInt(number, 10) < 10 ? `0${number}` : number - } - - return `${formatted.year}-${trail(formatted.month)}-${trail(formatted.day)} ${trail( - formatted.hour - )}:${trail(formatted.minute)}` - }, - toDateTimeFromUnix: (date) => { - const formatted = DateTime.fromSeconds(parseInt(date, 10)) - - const trail = (number) => { - return parseInt(number, 10) < 10 ? `0${number}` : number - } - - return `${trail(formatted.month)}.${trail(formatted.day)}.${formatted.year} ${trail( - formatted.hour - )}:${trail(formatted.minute)}` - }, isoDateOnly: (date) => { let d = new Date(date) let month = '' + (d.getMonth() + 1) diff --git a/src/social-preview.liquid b/src/social-preview.liquid index 47992735..fe91e011 100644 --- a/src/social-preview.liquid +++ b/src/social-preview.liquid @@ -9,7 +9,7 @@ eleventyExcludeFromCollections: true - {% assign titleInLines = preview.data.title | splitlines: 40 %} + {% assign titleInLines = preview.data.title | splitLines: 40 %} {% assign numberOfLines = titleInLines.length %} {% if numberOfLines == 2 %} {% assign verticalStartingPoint = 250 %}