shortcode->getHandlers()->add('scrolly-section', function (ShortcodeInterface $sc) { $plugin = $this->grav['plugins']->getPlugin('story-blocks'); $page = $plugin ? $plugin->getCurrentPage() : null; $imageName = $sc->getParameter('image', ''); $alt = htmlspecialchars($sc->getParameter('alt', ''), ENT_QUOTES); $caption = htmlspecialchars($sc->getParameter('caption', ''), ENT_QUOTES); $content = $sc->getContent(); /* raw inner content — Scrollama JS splits on
*/ $imageUrl = ($page && $imageName) ? $page->url() . '/' . $imageName : $imageName; $captionHtml = $caption ? '

' . $caption . '

' : ''; return <<
{$content}
HTML; }); } }