chore: move artist alias data to json file
This commit is contained in:
parent
e62b5276a6
commit
1da33bb2ea
3 changed files with 15 additions and 13 deletions
12
src/_data/json/artist-aliases.json
Normal file
12
src/_data/json/artist-aliases.json
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"aliases": [
|
||||||
|
{
|
||||||
|
"artist": "Osees",
|
||||||
|
"aliases": ["OCS", "The Ohsees", "Thee Oh Sees", "Thee Oh See's"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"artist": "Tom Waits",
|
||||||
|
"aliases": ["Tom Waits & Crystal Gayle"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -1,19 +1,9 @@
|
||||||
const { AssetCache } = require('@11ty/eleventy-fetch')
|
const { AssetCache } = require('@11ty/eleventy-fetch')
|
||||||
|
const artistAliases = require('./json/artist-aliases.json')
|
||||||
const artistAliases = [
|
|
||||||
{
|
|
||||||
artist: 'Osees',
|
|
||||||
aliases: ['OCS', 'The Ohsees', 'Thee Oh Sees', "Thee Oh See's"],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
artist: 'Tom Waits',
|
|
||||||
aliases: ['Tom Waits & Crystal Gayle'],
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
const aliasArtists = (array) => {
|
const aliasArtists = (array) => {
|
||||||
array.forEach((a) => {
|
array.forEach((a) => {
|
||||||
const aliased = artistAliases.find((alias) => alias.aliases.includes(a.artist))
|
const aliased = artistAliases.aliases.find((alias) => alias.aliases.includes(a.artist))
|
||||||
if (aliased) a.artist = aliased.artist
|
if (aliased) a.artist = aliased.artist
|
||||||
})
|
})
|
||||||
return array
|
return array
|
||||||
|
|
|
@ -90,7 +90,7 @@ layout: main
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{%- capture albumName %}{{ album.name | escape }}{% endcapture -%}
|
{%- capture albumName %}{{ album.name | escape }}{% endcapture -%}
|
||||||
{% image album.art, albumName, 'rounded-lg w-full', '225px' %}
|
{% image album.art, albumName, 'rounded-lg w-full h-full', '225px' %}
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
Reference in a new issue