feat: upgrade to 11ty 3.0.0@alpha

This commit is contained in:
Cory Dransfeldt 2023-12-21 13:31:57 -08:00
parent 2cd8e4a380
commit e16633653a
No known key found for this signature in database
43 changed files with 578 additions and 5039 deletions

View file

@ -1,13 +1,16 @@
import { createRequire } from 'module'
const require = createRequire(import.meta.url)
const chartData = require('./json/weekly-artist-charts.json')
const charts = chartData['charts']
module.exports = async function () {
export default async function () {
return charts.map((chart) => {
const artists = chart['weeklyartistchart']['artist'].splice(0, 8)
const date = parseInt(chart['weeklyartistchart']['@attr']['to']) * 1000
let content = 'My top artists for the week: '
artists.forEach((artist, index) => {
const artistName = artist['name'].replace('&', 'and');
const artistName = artist['name'].replace('&', 'and')
content += `${artistName} @ ${artist['playcount']} play${
parseInt(artist['playcount']) > 1 ? 's' : ''
}`