fix: feed links

This commit is contained in:
Cory Dransfeldt 2024-02-19 09:46:57 -08:00
parent e4b397026f
commit bb6f9a3ec2
No known key found for this signature in database
5 changed files with 33 additions and 16 deletions

View file

@ -1,6 +1,10 @@
import { DateTime } from 'luxon'
import markdownIt from 'markdown-it'
import { URL } from 'url'
import { createRequire } from 'module'
const require = createRequire(import.meta.url)
const metaData = require('../../src/_data/json/meta.json')
const utmPattern = /[?&](utm_[^&=]+=[^&#]*)/gi
const BASE_URL = 'https://coryd.dev'
@ -90,6 +94,13 @@ export default {
if (!url || !posts) return null;
return posts[url]?.toots?.[0] || null;
},
absoluteUrl: (url, base) => {
if (!base) base = metaData.url
try {
return (new URL(url, base)).toString()
} catch(e) {}
return url;
},
// feeds
normalizeEntries: (entries) => {