fix: feed data
This commit is contained in:
parent
99283e731a
commit
427a73cd94
6 changed files with 17 additions and 18 deletions
|
@ -89,6 +89,7 @@ export const processContent = (collection) => {
|
||||||
let attribution
|
let attribution
|
||||||
let hashTags = tagsToHashtags(item) ? ' ' + tagsToHashtags(item) : ''
|
let hashTags = tagsToHashtags(item) ? ' ' + tagsToHashtags(item) : ''
|
||||||
if (item['type'] === 'album-release') hashTags = ' #Music #NewMusic'
|
if (item['type'] === 'album-release') hashTags = ' #Music #NewMusic'
|
||||||
|
if (item['type'] === 'concert') hashTags = ' #Music #Concert'
|
||||||
|
|
||||||
// link attribution if properties exist
|
// link attribution if properties exist
|
||||||
if (item?.['authors']?.['mastodon']) {
|
if (item?.['authors']?.['mastodon']) {
|
||||||
|
@ -113,9 +114,9 @@ export const processContent = (collection) => {
|
||||||
// link to artist concerts section if available - artistUrl is only present on concert objects here
|
// link to artist concerts section if available - artistUrl is only present on concert objects here
|
||||||
if (item?.['artistUrl']) content['url'] = `${item['artistUrl']}?t=${DateTime.fromISO(item['date']).toMillis()}#concerts`
|
if (item?.['artistUrl']) content['url'] = `${item['artistUrl']}?t=${DateTime.fromISO(item['date']).toMillis()}#concerts`
|
||||||
if (item?.['description']) {
|
if (item?.['description']) {
|
||||||
content['description'] = `${item['description'].split(' ').slice(0, 25).join(' ')}...`
|
content['description'] = `${item['description'].split(' ').length >= 25 ? item['description'].split(' ').slice(0, 25).join(' ') + '...' : item['description']}`
|
||||||
} else if (item?.['notes']) {
|
} else if (item?.['notes']) {
|
||||||
content['notes'] = `${item['notes'].split(' ').slice(0, 25).join(' ')}...`
|
content['notes'] = `${item['notes'].split(' ').length >= 25 ? item['description'].split(' ').slice(0, 25).join(' ') + '...' : item['description']}`
|
||||||
} else {
|
} else {
|
||||||
content['description'] = ''
|
content['description'] = ''
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,12 +71,7 @@ export default {
|
||||||
|
|
||||||
if (rating) processedEntry['rating'] = rating
|
if (rating) processedEntry['rating'] = rating
|
||||||
if (tags) processedEntry['tags'] = tags
|
if (tags) processedEntry['tags'] = tags
|
||||||
if (type === 'album-release') {
|
if (type === 'album-release' && artist) processedEntry['title'] = `${title} by ${artist}`
|
||||||
if (artist) processedEntry['title'] = `${title} by ${artist}`
|
|
||||||
processedEntry['excerpt'] = 'Check out the new release!'
|
|
||||||
processedEntry['content'] = 'Check out the new release!'
|
|
||||||
}
|
|
||||||
|
|
||||||
if (entry) posts.push(processedEntry)
|
if (entry) posts.push(processedEntry)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
16
package-lock.json
generated
16
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "coryd.dev",
|
"name": "coryd.dev",
|
||||||
"version": "24.8.3",
|
"version": "24.8.4",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "coryd.dev",
|
"name": "coryd.dev",
|
||||||
"version": "24.8.3",
|
"version": "24.8.4",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@cdransf/api-text": "^1.5.0",
|
"@cdransf/api-text": "^1.5.0",
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
"markdown-it": "^14.1.0",
|
"markdown-it": "^14.1.0",
|
||||||
"markdown-it-anchor": "^9.2.0",
|
"markdown-it-anchor": "^9.2.0",
|
||||||
"markdown-it-footnote": "^4.0.0",
|
"markdown-it-footnote": "^4.0.0",
|
||||||
"postcss": "^8.4.45",
|
"postcss": "^8.4.47",
|
||||||
"postcss-cli": "^11.0.0",
|
"postcss-cli": "^11.0.0",
|
||||||
"postcss-import": "^16.1.0",
|
"postcss-import": "^16.1.0",
|
||||||
"postcss-import-ext-glob": "^2.1.1",
|
"postcss-import-ext-glob": "^2.1.1",
|
||||||
|
@ -3261,9 +3261,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/postcss": {
|
"node_modules/postcss": {
|
||||||
"version": "8.4.45",
|
"version": "8.4.47",
|
||||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.45.tgz",
|
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.47.tgz",
|
||||||
"integrity": "sha512-7KTLTdzdZZYscUc65XmjFiB73vBhBfbPztCYdUNvlaso9PrzjzcmjqBPR0lNGkcVlcO4BjiO5rK/qNz+XAen1Q==",
|
"integrity": "sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -3282,8 +3282,8 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"nanoid": "^3.3.7",
|
"nanoid": "^3.3.7",
|
||||||
"picocolors": "^1.0.1",
|
"picocolors": "^1.1.0",
|
||||||
"source-map-js": "^1.2.0"
|
"source-map-js": "^1.2.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^10 || ^12 || >=14"
|
"node": "^10 || ^12 || >=14"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "coryd.dev",
|
"name": "coryd.dev",
|
||||||
"version": "24.8.3",
|
"version": "24.8.4",
|
||||||
"description": "The source for my personal site. Built using 11ty (and other tools).",
|
"description": "The source for my personal site. Built using 11ty (and other tools).",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
"markdown-it": "^14.1.0",
|
"markdown-it": "^14.1.0",
|
||||||
"markdown-it-anchor": "^9.2.0",
|
"markdown-it-anchor": "^9.2.0",
|
||||||
"markdown-it-footnote": "^4.0.0",
|
"markdown-it-footnote": "^4.0.0",
|
||||||
"postcss": "^8.4.45",
|
"postcss": "^8.4.47",
|
||||||
"postcss-cli": "^11.0.0",
|
"postcss-cli": "^11.0.0",
|
||||||
"postcss-import": "^16.1.0",
|
"postcss-import": "^16.1.0",
|
||||||
"postcss-import-ext-glob": "^2.1.1",
|
"postcss-import-ext-glob": "^2.1.1",
|
||||||
|
|
|
@ -30,6 +30,7 @@ const fetchAlbumReleases = async () => {
|
||||||
artist: album['artist_name'],
|
artist: album['artist_name'],
|
||||||
title: album['name'],
|
title: album['name'],
|
||||||
date: releaseDate.toLocaleString(DateTime.DATE_FULL),
|
date: releaseDate.toLocaleString(DateTime.DATE_FULL),
|
||||||
|
description: 'Check out the new release!',
|
||||||
url: album['release_link'],
|
url: album['release_link'],
|
||||||
image: album['art'] ? `/${album['art']}` : '',
|
image: album['art'] ? `/${album['art']}` : '',
|
||||||
total_plays: album['total_plays'],
|
total_plays: album['total_plays'],
|
||||||
|
|
|
@ -47,6 +47,7 @@ const fetchAllConcerts = async () => {
|
||||||
const processConcerts = (concerts) => {
|
const processConcerts = (concerts) => {
|
||||||
return concerts.map(concert => ({
|
return concerts.map(concert => ({
|
||||||
id: concert['id'],
|
id: concert['id'],
|
||||||
|
type: 'concert',
|
||||||
date: concert['date'],
|
date: concert['date'],
|
||||||
artistNameString: concert['artist_name_string'],
|
artistNameString: concert['artist_name_string'],
|
||||||
venue: {
|
venue: {
|
||||||
|
@ -56,6 +57,7 @@ const processConcerts = (concerts) => {
|
||||||
boundingBox: concert['bounding_box'],
|
boundingBox: concert['bounding_box'],
|
||||||
notes: concert['venue_notes']
|
notes: concert['venue_notes']
|
||||||
},
|
},
|
||||||
|
description: 'I went to (yet another) concert!',
|
||||||
notes: concert['concert_notes'],
|
notes: concert['concert_notes'],
|
||||||
artist: concert['artist'] ? {
|
artist: concert['artist'] ? {
|
||||||
name: concert['artist_name'],
|
name: concert['artist_name'],
|
||||||
|
|
Reference in a new issue