From d15d4e00abb243f6c582c981dc1c3201b3a693c6 Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Sat, 3 Jun 2023 20:01:05 -0700 Subject: [PATCH] feat: add book images --- config/mediaFilters.js | 3 + src/_data/books.js | 8 +- src/_data/site.json | 4 +- src/_includes/now.liquid | 160 ++++++++++++++--------------- src/assets/img/media/404-movie.jpg | Bin 1971 -> 0 bytes src/assets/img/media/404-music.jpg | Bin 4146 -> 0 bytes 6 files changed, 91 insertions(+), 84 deletions(-) delete mode 100644 src/assets/img/media/404-movie.jpg delete mode 100644 src/assets/img/media/404-music.jpg diff --git a/config/mediaFilters.js b/config/mediaFilters.js index 38fd9c37..d21cc164 100644 --- a/config/mediaFilters.js +++ b/config/mediaFilters.js @@ -15,4 +15,7 @@ module.exports = { movie: (url, host, cdn) => { return url.replace(host, cdn).replace('600', '200').replace('900', '300') }, + book: (url, host, cdn) => { + return url.replace(host, cdn) + }, } diff --git a/src/_data/books.js b/src/_data/books.js index 2e0e7897..747b2246 100644 --- a/src/_data/books.js +++ b/src/_data/books.js @@ -6,7 +6,13 @@ module.exports = async function () { // noinspection JSCheckFunctionSignatures const asset = new AssetCache('books_data') if (asset.isCacheValid('1h')) return await asset.getCachedValue() - const res = await extract(url) + const res = await extract(url, { + getExtraEntryFields: (feedEntry) => { + return { + image: feedEntry['oku:cover'] || 'https://cdn.coryd.dev/books/missing-book.jpg', + } + }, + }) .catch((error) => { console.log(error.message) }) diff --git a/src/_data/site.json b/src/_data/site.json index 0de58a56..a537f112 100644 --- a/src/_data/site.json +++ b/src/_data/site.json @@ -13,8 +13,10 @@ "instapaper": "https://www.instapaper.com/p/coryd", "letterboxd": "https://letterboxd.com/cdme", "letterboxd-host": "https://a.ltrbxd.com", + "oku-host": "https://oku.ams3.cdn.digitaloceanspaces.com", "trakt": "https://trakt.tv/users/cdransf", "oku": "https://oku.club/user/cory", "coffee": "https://www.buymeacoffee.com/cory", - "cdn-movies": "https://movies.coryd.dev" + "cdn-movies": "https://movies.coryd.dev", + "cdn-books": "https://books.coryd.dev" } diff --git a/src/_includes/now.liquid b/src/_includes/now.liquid index 6faa17df..51e2895b 100644 --- a/src/_includes/now.liquid +++ b/src/_includes/now.liquid @@ -39,117 +39,113 @@ layout: main Assembling lists of ad and tracker-blocking tools.

- {% if books.size > 0 %} -

- Reading: books -

-
- -
- {% endif %} {% if artists.size > 0 %}

Listening: artists

-
-
- {% for artist in artists %} - -
-
-
-
{{ artist.name }}
-
- {{ artist.playcount }} plays -
+
+ {% for artist in artists %} + + + {%- capture artistImg %}{{ artist.name | artist }}{% endcapture -%} + {%- capture artistName %}{{ artist.name | escape }}{% endcapture -%} + {% image artistImg, artistName, 'rounded-lg', '225px', 'eager' %} +
+ + {% endfor %}
{% endif %} {% if albums.size > 0 %}

Listening: albums

-
-
- {% for album in albums %} - -
-
-
-
{{ album.name }}
-
- {{ album.artist.name }} -
+
+ {% for album in albums %} + + + {%- capture albumImg %}{{ album | album }}{% endcapture -%} + {%- capture albumName %}{{ album.name | escape }}{% endcapture -%} + {% image albumImg, albumName, 'rounded-lg', '225px' %} +
+ + {% endfor %} +
+ {% endif %} + {% if books.size > 0 %} +

+ Reading: books +

+ {% endif %} {% if movies.size > 0 %}

Watching: movies

-
-
- {% for movie in movies %} - -
-
-
-
{{ movie.title }}
-
- {%- capture movieImg %}{{movie.image | movie: site.letterboxd-host, site.cdn-movies}}{% endcapture -%} - {%- capture movieName %}{{movie.title | escape}}{% endcapture -%} - {% image movieImg, movieName, 'rounded-lg w-full', '180px' %} +
+ {% for movie in movies %} + + + {%- capture movieImg %}{{movie.image | movie: site.letterboxd-host, site.cdn-movies}}{% endcapture -%} + {%- capture movieName %}{{movie.title | escape}}{% endcapture -%} + {% image movieImg, movieName, 'rounded-lg w-full', '180px' %} +
+ + {% endfor %}
{% endif %} {% if tv.size > 0 %}

Watching: tv

-
-
- {% for episode in tv %} - -
-
-
{% endif %}

This is a diff --git a/src/assets/img/media/404-movie.jpg b/src/assets/img/media/404-movie.jpg deleted file mode 100644 index 677f5a325b5239623ff55117ab7cd34de71052cd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1971 zcmbtVX;hO}6Mo+}fC)<^fgqHEAs|bDuo?_tY0}TI8c4z-(1NlQ!yd#4+7?>@m9Gev zEfmnA5R5FcgdH0cupo*>7Ll?qrK~L~Vu6qbX+56v{p$Hh2$<>b){NQtA>QOYREQCHPaRgqjnoTetu z&>XLiH@77cZCxB(f`XF4{}(`fA3(u@NgxLX;s6K*!cd^N9r#c}5Q1P5mhTLXfcC(o zWu(Nz0DPwh0LVT5?(zNLw4X9;l=Fk(#i$Mf_MtaxQ4{nr--fm(3%>rO)C}}yP(O@L zW)cs2H^}y6nF`M)Cx72deGGWU@{>0EEiDIAh$o@yqHhmP%JafQYoakXO(slw)P|I; zYZNhU4Y)MLU?ag=8nDo!zo&8e{QEz@7w?xep$fjW_p$&CgmxQ%6#q$E*=x=7N$qD@ zS3*$pJW{?ruV@a{MB07cD}mYfKPUhM!rqPn_726=l0^0j%*^AE9P0x!F&tCNT>v`? zfQ2Fe!a&LBq@`fHSrCFrNdq!_P+>zi5c6ePaUGd+pV^~&sI>%UY!s2w*O^7=|!KwF`S zJ3^ndH(BsgVs6ZS2kfDRLGYC2+`?q#^As_lh`3H&FX*f9R@mN3QXe}*8#l7re4!i_KWg(u<@oQN^t*GhOPmwJ zR$j%WRZxNSZt$Nzw_Min^=ksYF&IPvu zPT1q4B|p-27(vFY&m(5dMi{pDke#C>Z&7~qkmEv%01OHrP40>?V4jv%G{>8VcNnMW>UZ$$8Qt_KC1Y&q3gcp{rotZq z{Ae?V%Us~EOQEf|O!sj=;ZL!dA)J!@Y3GldmLU3em*8TS*1EqNNHccECg6AJ7p_aG zYlr4e3X(qK*jxz9Me`F@X;QaVt9=K8dJ@ib_MJR+>5k0m$Y#~KW6qdiCi>}hgJW8( z?NZu*eA63T`vRM@_>q)JyQ5cDJc}FU5=BItMxX2%g3_y@mD$jLQxevEs-mMe*yZPW z`eddo z018cquw*T_U0vSc@h45`zck}Rf~nUi!bYHGna!=V3T~E?lWw-z+Mq_i{WBWnYOQvd d>c%2+0jKfm!Qo?PJP}E{%3Q_?e_!$QzW_7U7n}e9 diff --git a/src/assets/img/media/404-music.jpg b/src/assets/img/media/404-music.jpg deleted file mode 100644 index 69210bc47180880e091e819c4e85c34a08bb6fb1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4146 zcmb_f2{@E(_kU)_AlXLQmk2SY64|pwg|Rd!LSt=YC`?F*rijMAWs9tnt)UR+wUq2T zV+~1YWXnegk#E#nZ~y=Qy}s{%UEg=^=eeG9?sM+@ob!9m{aokS9p0S)*pcV-&H*40 z0Dx!%*c}Ce0O)t3rxD{m+F;(##I&E8gN2ngIQU@)VYG{%N05h$b|Vf82^~hrN=Zt| zswya`8t58axe^TePdC_o4Zs*d)*x#L=r90=fgmu@ZUZ1l3lIW;A+#`m5(DEt5IvX< z3fUb2826F@0J7~*<-dKhS#uMPM)~g933%Q@!a_ATAJhobB%x{rWe<)HH?8l|#b6P3ik#)$w4man;Z5<;*Sv zh==??9CszfoyENRcj^k`ufMOBJjnesh9jZvcr`|oKeSwaGhju~fw(uqe$31e%FHec zTs1&K@7Le~fUO=;s}S0Luhy9T2P&%~Dnx!-Ob3I@ffp6*0HBU`49r@BWtB|i$)8|T zQ&^&9Ur236L(XFA`ad5SU_<0y1pqMqbOvn|qcdUc3+B<&j!+tOk5=*6+d-@KUTyP2-8m-H%tN0Hz^H?_3_h zEIF`7=@q!F<6tjMXV8c^FN23xb@V!<+Cs4wjxGz2QS=2I9Yyhfxr+tC_MuVVB}C_KX5`u)A)v0iLl6N&%32%^#>0t zXq(t^YN6~Ma2_#o_$(e#*^_7P#nw^&JeMF1U>A_O=ofrn6C-_bF8aNQj#zQN&sJbRMr{b-8jE)UnbIeG_818cteakF zTXuUmD%tqL%}}Pz(DOuzb*cFHdqj4CH`cRK#+!Aqrp&Oo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