diff --git a/src/_data/movies.js b/src/_data/movies.js index f1a495ff..5c0cec52 100644 --- a/src/_data/movies.js +++ b/src/_data/movies.js @@ -12,10 +12,18 @@ module.exports = async function () { const data = res.items .map((item) => { const images = item['content']?.match(/<img [^>]*src="[^"]*"[^>]*>/gm) || [] - item.image = images.length - ? images.map((image) => image.replace(/.*src="([^"]*)".*/, '$1'))[0] - : 'https://cdn.coryd.dev/movies/missing-movie.jpg' - return item + return { + name: item['title'], + date: item['pubDate'], + summary: item['contentSnippet'], + image: images.length + ? images + .map((image) => image.replace(/.*src="([^"]*)".*/, '$1'))[0] + .replace('https://a.ltrbxd.com', 'https://movies.coryd.dev') + : 'https://cdn.coryd.dev/movies/missing-movie.jpg', + url: item['link'], + id: item['guid'], + } }) .splice(0, 6) await asset.save(data, 'json') diff --git a/src/_data/site.js b/src/_data/site.js index dd085e90..84ca0e04 100644 --- a/src/_data/site.js +++ b/src/_data/site.js @@ -7,7 +7,5 @@ module.exports = async function () { title: 'Cory Dransfeldt', description: "I'm a software developer in Camarillo, California. I enjoy hanging out with my beautiful family and 4 rescue dogs, technology, automation, music, writing, reading and tv and movies.", - 'letterboxd-host': 'https://a.ltrbxd.com', - 'cdn-movies': 'https://movies.coryd.dev', } } diff --git a/src/_includes/partials/now/movies.liquid b/src/_includes/partials/now/movies.liquid index 14660051..0b93ce2e 100644 --- a/src/_includes/partials/now/movies.liquid +++ b/src/_includes/partials/now/movies.liquid @@ -5,15 +5,15 @@ </h2> <div class="grid grid-cols-3 gap-2 md:grid-cols-6 not-prose"> {% for movie in movies %} - <a href="{{movie.link}}" title="{{movie.title | escape}}"> + <a href="{{movie.url}}" title="{{movie.name | escape}}"> <div class="relative block" style="max-width:226px"> <div class="absolute left-0 top-0 h-full w-full rounded-lg border border-purple-600 hover:border-pink-500 bg-cover-gradient dark:border-purple-400 dark:hover:border-pink-500 ease-in-out duration-300"></div> <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.name }}</div> </div> - {%- capture movieImg %}{{movie.image | cdn: site.letterboxd-host, site.cdn-movies}}{% endcapture -%} - {%- capture movieName %}{{movie.title | escape}} - {{ movie.contentSnippet }}{% endcapture -%} - {% image movieImg, movieName, 'rounded-lg w-full', '180px' %} + {%- capture movieImg %}{{ movie.image }}{% endcapture -%} + {%- capture movieSummary %}{{ movie.summary }}{% endcapture -%} + {% image movieImg, movieSummary, 'rounded-lg w-full', '180px' %} </div> </a> {% endfor %}