chore: remove duplicate filters + unnecessary url transform
This commit is contained in:
parent
ffdc2effbc
commit
881aca29c5
2 changed files with 3 additions and 6 deletions
|
@ -12,10 +12,7 @@ module.exports = {
|
||||||
: `https://cdn.coryd.dev/albums/${media.name.replace(/\s+/g, '-').toLowerCase()}.jpg`
|
: `https://cdn.coryd.dev/albums/${media.name.replace(/\s+/g, '-').toLowerCase()}.jpg`
|
||||||
},
|
},
|
||||||
tv: (episode) => `https://cdn.coryd.dev/tv/${episode.replace(/\s+/g, '-').toLowerCase()}.jpg`,
|
tv: (episode) => `https://cdn.coryd.dev/tv/${episode.replace(/\s+/g, '-').toLowerCase()}.jpg`,
|
||||||
movie: (url, host, cdn) => {
|
cdn: (url, host, cdn) => {
|
||||||
return url.replace(host, cdn).replace('600', '200').replace('900', '300')
|
|
||||||
},
|
|
||||||
book: (url, host, cdn) => {
|
|
||||||
return url.replace(host, cdn)
|
return url.replace(host, cdn)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,7 +102,7 @@ layout: main
|
||||||
<div class="absolute left-1 bottom-2 drop-shadow-md">
|
<div class="absolute left-1 bottom-2 drop-shadow-md">
|
||||||
<div class="px-1 text-xs font-bold text-white">{{ book.title }}</div>
|
<div class="px-1 text-xs font-bold text-white">{{ book.title }}</div>
|
||||||
</div>
|
</div>
|
||||||
{%- capture bookImg %}{{book.image | book: site.oku-host, site.cdn-books}}{% endcapture -%}
|
{%- capture bookImg %}{{book.image | cdn: site.oku-host, site.cdn-books}}{% endcapture -%}
|
||||||
{%- capture bookName %}{{book.title | escape}}{% endcapture -%}
|
{%- capture bookName %}{{book.title | escape}}{% endcapture -%}
|
||||||
{% image bookImg, bookName, 'rounded-lg w-full', '180px' %}
|
{% image bookImg, bookName, 'rounded-lg w-full', '180px' %}
|
||||||
</div>
|
</div>
|
||||||
|
@ -140,7 +140,7 @@ layout: main
|
||||||
<div class="absolute left-1 bottom-2 drop-shadow-md">
|
<div class="absolute left-1 bottom-2 drop-shadow-md">
|
||||||
<div class="px-1 text-xs font-bold text-white">{{ movie.title }}</div>
|
<div class="px-1 text-xs font-bold text-white">{{ movie.title }}</div>
|
||||||
</div>
|
</div>
|
||||||
{%- capture movieImg %}{{movie.image | movie: site.letterboxd-host, site.cdn-movies}}{% endcapture -%}
|
{%- capture movieImg %}{{movie.image | cdn: site.letterboxd-host, site.cdn-movies}}{% endcapture -%}
|
||||||
{%- capture movieName %}{{movie.title | escape}}{% endcapture -%}
|
{%- capture movieName %}{{movie.title | escape}}{% endcapture -%}
|
||||||
{% image movieImg, movieName, 'rounded-lg w-full', '180px' %}
|
{% image movieImg, movieName, 'rounded-lg w-full', '180px' %}
|
||||||
</div>
|
</div>
|
||||||
|
|
Reference in a new issue