chore: prune unused filters
This commit is contained in:
parent
2a2e607572
commit
5a3ce74518
2 changed files with 2 additions and 23 deletions
|
@ -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)
|
||||
|
|
|
@ -9,7 +9,7 @@ eleventyExcludeFromCollections: true
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="1200" height="628" viewBox="0 0 1200 628" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
>
|
||||
{% assign titleInLines = preview.data.title | splitlines: 40 %}
|
||||
{% assign titleInLines = preview.data.title | splitLines: 40 %}
|
||||
{% assign numberOfLines = titleInLines.length %}
|
||||
{% if numberOfLines == 2 %}
|
||||
{% assign verticalStartingPoint = 250 %}
|
||||
|
|
Reference in a new issue