Merge ; commit '558906cec3'

This commit is contained in:
Cory Dransfeldt 2024-05-23 14:26:32 -07:00
commit 0177a8cbea
27 changed files with 375 additions and 177 deletions

View file

@ -1,3 +1,4 @@
import authors from '../data/author-map.js'
import tagAliases from '../data/tag-aliases.js'
import { DateTime } from 'luxon'
@ -45,12 +46,19 @@ export const allContent = (collection) => {
if (!parsedDate.isValid) parsedDate = DateTime.fromFormat(date, 'dd-MM-yyyy')
return parsedDate.isValid ? parsedDate.toISO() : null
}
const authorLookup = (url) => {
if (!url) return null
const urlObject = new URL(url)
const baseUrl = urlObject.origin
return authors?.[baseUrl] || null
}
const addContent = (items, icon, getTitle, getDate) => {
if (items) {
items.forEach(item => {
const author = authorLookup(item.data?.link)
const content = {
url: item.url?.includes('http') ? item.url : `https://coryd.dev${item.url}`,
title: `${icon}: ${getTitle(item)}`
title: `${icon}: ${getTitle(item)}${author ? ' via ' + author : ''}`
}
if (item.data?.link) content.url = item.data?.link
if (item.data?.description) content.description = `${item.data.description}<br/><br/>`

View file

@ -1,5 +1,7 @@
export default {
"https://knowler.dev": "Nathan Knowler",
"https://www.vox.com": "Vox",
"https://rachsmith.com": "Rach Smith",
"https://zicklepop.com": "zicklepop",
"https://simonwillison.net": "Simon Willison",
"https://futurism.com": "Futurism",

View file

@ -248,6 +248,7 @@ export default {
return ''
}).length
},
getLastWatched: (show) => show?.['episodes'][show['episodes']?.length - 1]?.['last_watched_at'],
// tags
filterTags: (tags) => {