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

65 lines
2.4 KiB
Text

---
permalink: /watching/movies/index.php
type: dynamic
schema: movie
---
<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="
<?= htmlspecialchars($movie["backdrop"]) ?>?class=bannersm&type=webp 256w,
<?= htmlspecialchars($movie["backdrop"]) ?>?class=bannermd&type=webp 512w,
<?= htmlspecialchars($movie["backdrop"]) ?>?class=bannerbase&type=webp 1024w
"
sizes="(max-width: 450px) 256px,
(max-width: 850px) 512px,
1024px"
src="<?= htmlspecialchars($movie["backdrop"]) ?>?class=bannersm&type=webp"
alt="<?= htmlspecialchars($movie["title"]) ?> (<?= htmlspecialchars($movie["year"]) ?>)"
class="image-banner"
decoding="async"
width="256"
height="180"
>
<div class="media-meta">
<h2 class="page-title"><?= htmlspecialchars($movie["title"]) ?> (<?= htmlspecialchars($movie["year"]) ?>)</h2>
<?php if (!empty($movie["tags"])): ?>
<?php renderTags($movie["tags"] ?? []); ?>
<?php endif; ?>
<?php if (!empty($movie["rating"])): ?>
<span><?= htmlspecialchars($movie["rating"]) ?></span>
<?php endif; ?>
<?php if ($movie["favorite"]): ?>
<span class="sub-meta favorite">{% tablericon "heart" %} This is one of my favorite movies!</span>
<?php endif; ?>
<?php if ($movie["tattoo"]): ?>
<span class="sub-meta tattoo">{% tablericon "needle" %} I have a tattoo inspired by this movie!</span>
<?php endif; ?>
<?php if (!empty($movie["last_watched"])): ?>
<?php
$date = new DateTime($movie["last_watched"]);
$date->setTimezone(new DateTimeZone('America/Los_Angeles'));
?>
<span class="sub-meta">Last watched on <?= $date->format('F j, Y') ?>.</span>
<?php endif; ?>
</div>
<?php if (!empty($movie["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($movie["review"]) ?>
<?php endif; ?>
<?php
renderAssociatedMedia(
$movie["artists"] ?? [],
$movie["books"] ?? [],
$movie["genres"] ?? [],
$movie["related_movies"] ?? [],
$movie["posts"] ?? [],
$movie["shows"] ?? []
);
?>
<?php if (!empty($movie["description"])): ?>
<h2>Overview</h2>
<?= parseMarkdown($movie["description"]) ?>
<?php endif; ?>
</article>