Split block resolver into its own file
This commit is contained in:
parent
a55eff173b
commit
1b032f98ff
3 changed files with 17 additions and 28 deletions
|
@ -23,19 +23,7 @@
|
|||
{% endif -%}
|
||||
|
||||
{% for content_block in content_blocks %}
|
||||
{% 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}}>
|
||||
{% else %}
|
||||
<b>UNSUPPORTED block type here!</b>
|
||||
{% endmatch %}
|
||||
{% include "resolve_content.html" %}
|
||||
{% endfor %}
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -34,20 +34,7 @@
|
|||
<br />
|
||||
|
||||
{% for content_block in content_blocks %}
|
||||
{% 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}}>
|
||||
{% else %}
|
||||
<b>UNSUPPORTED block type here!</b>
|
||||
{% endmatch %}
|
||||
{% include "resolve_content.html" %}
|
||||
{% endfor %}
|
||||
|
||||
<br />
|
||||
|
|
14
templates/resolve_content.html
Normal file
14
templates/resolve_content.html
Normal file
|
@ -0,0 +1,14 @@
|
|||
{% 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}}>
|
||||
{% else %}
|
||||
<b>UNSUPPORTED block type here!</b>
|
||||
{% endmatch %}
|
Reference in a new issue