This repository has been archived on 2025-02-09. You can view files and clone it, but cannot push or open issues or pull requests.
kyanite/templates/resolve_content.html
2023-02-08 05:16:23 -08:00

45 lines
1.5 KiB
HTML

{% match content_block %}
{% when BlockTypes::HR %}
<hr />
{% when BlockTypes::PARAGRAPH { text } %}
<p>{{ text }}</p>
{% when BlockTypes::MARKDOWN { content } %}
{{ content|markdown }}
{% when BlockTypes::HTML { content } %}
{{ content|safe }}
{% when BlockTypes::HEADER { id, text, size } %}
<h{{ size }} id="{{ id }}">{{ text }}</h{{ size }}>
{% when BlockTypes::IMAGE { content } %}
{% match content %}
{% when Some with (image) %}
<div class="image">
<img class="image"
src="{{ image.url }}"
{% match image.alt %}
{% when Some with (alt) %}
alt="{{ alt }}"
{% when None %}
{% endmatch %}
/>
{% match image.description %}
{% when Some with (image_description) %}
<i class="image">{{ image_description }}</i>
{% when None %}
{% endmatch %}
</div>
<br />
{% when None %}
{% endmatch %}
{% when BlockTypes::QUOTE { quote, caption } %}
<figure>
<blockquote>
<p>{{ quote }}</p>
</blockquote>
<cite>
{{ caption }}
</cite>
</figure>
{% else %}
<b>UNSUPPORTED block type here!</b>
{% endmatch %}