fix: story template-story class, datetime attr, imageName escaping, raw content comments
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vgmzx8VTTTmCskSpQtsLTr
This commit is contained in:
@@ -11,7 +11,7 @@ class ChapterBreakShortcode extends Shortcode
|
||||
$plugin = $this->grav['plugins']->getPlugin('story-blocks');
|
||||
$page = $plugin ? $plugin->getCurrentPage() : null;
|
||||
|
||||
$imageName = $sc->getParameter('image', '');
|
||||
$imageName = htmlspecialchars($sc->getParameter('image', ''), ENT_QUOTES);
|
||||
$title = htmlspecialchars($sc->getParameter('title', ''), ENT_QUOTES);
|
||||
$number = htmlspecialchars($sc->getParameter('number', ''), ENT_QUOTES);
|
||||
$alt = htmlspecialchars($sc->getParameter('alt', $title), ENT_QUOTES);
|
||||
|
||||
@@ -11,9 +11,9 @@ class PullQuoteShortcode extends Shortcode
|
||||
$plugin = $this->grav['plugins']->getPlugin('story-blocks');
|
||||
$page = $plugin ? $plugin->getCurrentPage() : null;
|
||||
|
||||
$imageName = $sc->getParameter('image', '');
|
||||
$imageName = htmlspecialchars($sc->getParameter('image', ''), ENT_QUOTES);
|
||||
$alt = htmlspecialchars($sc->getParameter('alt', ''), ENT_QUOTES);
|
||||
$content = trim($sc->getContent());
|
||||
$content = trim($sc->getContent()); // ShortcodeCore renders inner Markdown to HTML; trusted author content
|
||||
$imageUrl = ($page && $imageName) ? $page->url() . '/' . $imageName : '';
|
||||
|
||||
$bgHtml = '';
|
||||
|
||||
@@ -11,10 +11,10 @@ class ScrollySectionShortcode extends Shortcode
|
||||
$plugin = $this->grav['plugins']->getPlugin('story-blocks');
|
||||
$page = $plugin ? $plugin->getCurrentPage() : null;
|
||||
|
||||
$imageName = $sc->getParameter('image', '');
|
||||
$imageName = htmlspecialchars($sc->getParameter('image', ''), ENT_QUOTES);
|
||||
$alt = htmlspecialchars($sc->getParameter('alt', ''), ENT_QUOTES);
|
||||
$caption = htmlspecialchars($sc->getParameter('caption', ''), ENT_QUOTES);
|
||||
$content = $sc->getContent(); /* raw inner content — Scrollama JS splits on <hr> */
|
||||
$content = $sc->getContent(); // ShortcodeCore renders inner Markdown to HTML; trusted author content
|
||||
$imageUrl = ($page && $imageName) ? $page->url() . '/' . $imageName : $imageName;
|
||||
|
||||
$captionHtml = $caption
|
||||
|
||||
@@ -21,7 +21,7 @@ class SnapGalleryShortcode extends Shortcode
|
||||
|
||||
foreach ($images as $i => $filename) {
|
||||
if (!$filename) continue;
|
||||
$url = $baseUrl . $filename;
|
||||
$url = $baseUrl . htmlspecialchars($filename, ENT_QUOTES);
|
||||
$caption = htmlspecialchars($captions[$i] ?? '', ENT_QUOTES);
|
||||
$alt = htmlspecialchars($alts[$i] ?? '', ENT_QUOTES);
|
||||
$eager = $i === 0 ? 'eager' : 'lazy';
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
{{ assets.css()|raw }}
|
||||
{{ assets.js()|raw }}
|
||||
</head>
|
||||
<body class="{% if page.template == 'map' %}map-page{% endif %}{% if page.template == 'home' or page.template == 'trip' %} home-page{% endif %}">
|
||||
<body class="{% if page.template == 'map' %}map-page{% endif %}{% if page.template == 'home' or page.template == 'trip' %} home-page{% endif %}{% if page.template == 'story' %} template-story{% endif %}">
|
||||
<header class="site-header">
|
||||
<a class="site-title" href="{{ base_url_absolute }}">into the east</a>
|
||||
{% block nav %}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<div class="story-card__photo story-card__photo--empty"></div>
|
||||
{% endif %}
|
||||
<div class="story-card__body">
|
||||
<time class="story-card__date">{{ date_str }}</time>
|
||||
<time class="story-card__date" datetime="{{ story.date|date('Y-m-d') }}">{{ date_str }}</time>
|
||||
{% if story.header.location_name %}
|
||||
<span class="story-card__location">📍 {{ story.header.location_name }}{% if story.header.location_country %}, {{ story.header.location_country }}{% endif %}</span>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user