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

36 lines
1.3 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 { text, size } %}
<h{{size}}>{{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 %}
{% else %}
<b>UNSUPPORTED block type here!</b>
{% endmatch %}