coryd.dev/src/pages/dynamic/show.php.liquid

58 lines
2.3 KiB
Text

---
permalink: /watching/shows/index.php
type: dynamic
schema: show
---
<a class="back-link" href="/watching" title="Go back to the watching index page">{% tablericon "arrow-left" %} Back to watching</a>
<article class="watching-focus">
<img
srcset="
{{ globals.cdn_url }}<?= htmlspecialchars($show["backdrop"]) ?>?class=bannersm&type=webp 256w,
{{ globals.cdn_url }}<?= htmlspecialchars($show["backdrop"]) ?>?class=bannermd&type=webp 512w,
{{ globals.cdn_url }}<?= htmlspecialchars($show["backdrop"]) ?>?class=bannerbase&type=webp 1024w
"
sizes="(max-width: 450px) 256px,
(max-width: 850px) 512px,
1024px"
src="{{ globals.cdn_url }}<?= htmlspecialchars($show["backdrop"]) ?>?class=bannersm&type=webp"
alt="<?= htmlspecialchars($show["title"]) ?> (<?= htmlspecialchars($show["year"]) ?>)"
class="image-banner"
decoding="async"
width="256"
height="180"
/>
<div class="media-meta">
<h2><?= htmlspecialchars($show["title"]) ?> (<?= htmlspecialchars($show["year"]) ?>)</h2>
<?php if (!empty($show["favorite"])): ?>
<span class="sub-meta favorite">{% tablericon "heart" %} This is one of my favorite shows!</span>
<?php endif; ?>
<?php if (!empty($show["tattoo"])): ?>
<span class="sub-meta tattoo">{% tablericon "needle" %} I have a tattoo inspired by this show!</span>
<?php endif; ?>
<?php if (!empty($show["episode"]["formatted_episode"])): ?>
<span class="sub-meta">I last watched
<mark><?= htmlspecialchars($show["episode"]["formatted_episode"]) ?></mark>
on <?= date('F j, Y', strtotime($show["episode"]["last_watched_at"])) ?>.
</span>
<?php endif; ?>
</div>
<?php if (!empty($show["review"])): ?>
{% render "blocks/banners/warning.liquid", text: "There are probably spoilers after this banner — this is a warning about them." %}
<h2>My thoughts</h2>
<?= parseMarkdown($show["review"]) ?>
<?php endif; ?>
<?php
renderAssociatedMedia(
$show["artists"] ?? [],
$show["books"] ?? [],
$show["genres"] ?? [],
$show["movies"] ?? [],
$show["posts"] ?? [],
$show["related_shows"] ?? []
);
?>
<?php if (!empty($show["description"])): ?>
<h2>Overview</h2>
<?= parseMarkdown($show["description"]) ?>
<?php endif; ?>
</article>