feat: 11ty image plugin + optimize images
This commit is contained in:
parent
b59886a56e
commit
c87e893046
5 changed files with 39 additions and 54 deletions
|
@ -2,7 +2,7 @@ const ALBUM_DENYLIST = ['no-love-deep-web', 'unremittance']
|
|||
|
||||
module.exports = {
|
||||
artist: (media) =>
|
||||
`https://cdn.coryd.dev/artists/min/${media.replace(/\s+/g, '-').toLowerCase()}.webp`,
|
||||
`https://cdn.coryd.dev/artists/${media.replace(/\s+/g, '-').toLowerCase()}.jpg`,
|
||||
album: (media) => {
|
||||
return !ALBUM_DENYLIST.includes(media.name.replace(/\s+/g, '-').toLowerCase())
|
||||
? media.image[media.image.length - 1]['#text'].replace(
|
||||
|
@ -11,8 +11,7 @@ module.exports = {
|
|||
)
|
||||
: `https://cdn.coryd.dev/albums/${media.name.replace(/\s+/g, '-').toLowerCase()}.jpg`
|
||||
},
|
||||
tv: (episode) =>
|
||||
`https://cdn.coryd.dev/tv/min/${episode.replace(/\s+/g, '-').toLowerCase()}.webp`,
|
||||
tv: (episode) => `https://cdn.coryd.dev/tv/${episode.replace(/\s+/g, '-').toLowerCase()}.jpg`,
|
||||
movie: (url, host, cdn) => {
|
||||
return url.replace(host, cdn).replace('600', '200').replace('900', '300')
|
||||
},
|
||||
|
|
Reference in a new issue