Custom Kirby tag for quotes

This post is awaiting to be updated.

Speaking of quotes and multiple languages: to have the different language quote signs work we need to set the lang attribute on the blockquote element.


<blockquote lang="en"><p>Here’s a quote for ya!</p></blockquote>


<blockquote lang="fr"><p>Pardonnez my French</p></blockquote>

Markdown does not – that I know of – provide a way to add that attribute, but Kirbytext is based on Markdown and extendable with custom tags.

So here’s a custom quote tag with lang attribute:1

(\quote: Les vrais paradis sont les paradis qu'on a perdus. language: fr)

which shows

Les vrais paradis sont les paradis qu'on a perdus.

The code for this is Bastian’s original file kirbytext.extended.php extended with the function for the quote tag. This file goes in the plugins folder.

See this Gist file for quote tag

  1. To not have the tag being processed inside a code block add a '\' before the tag like \quote. Then in your template replace kirbytext($page->text()) with str_replace('(\', '(', kirbytext($page->text()))