chore: deduplicate permalinks; fix sitemap; organize

This commit is contained in:
Cory Dransfeldt 2024-07-15 22:52:57 -07:00
parent b40986256a
commit ae1cb3dc5e
No known key found for this signature in database
64 changed files with 94 additions and 31 deletions

View file

@ -1,18 +0,0 @@
import EleventyFetch from '@11ty/eleventy-fetch'
export default async function () {
const API_KEY_PLAUSIBLE = process.env.API_KEY_PLAUSIBLE
const url =
'https://plausible.io/api/v1/stats/breakdown?site_id=coryd.dev&period=6mo&property=event:page&limit=30'
const res = EleventyFetch(url, {
duration: '1h',
type: 'json',
fetchOptions: {
headers: {
Authorization: `Bearer ${API_KEY_PLAUSIBLE}`,
},
},
}).catch()
const pages = await res
return pages['results'].filter((p) => p['page'].includes('posts'))
}