{% extends "puput/base.html" %}
{% load wagtailcore_tags wagtailimages_tags puput_tags %}

{% block title %}{{ self.title }} | {{ blog_page.title }}{% endblock title %}
{% block meta_title %}{% if self.seo_title %}{{ self.seo_title }}{% else %}{{ self.title }}{% endif %}{% endblock meta_title %}
{% block meta_description %}{% if self.search_description %}{{ self.search_description }}{% else %}{{ self.body|striptags|truncatewords:20 }}{% endif %}{% endblock meta_description %}

{% block content %}
    <article class="box page-content" data-entry-page-update-comments-url="{% url 'entry_page_update_comments' self.id %}">
        {% include 'puput/entry_page_header.html' with entry=self %}
        <section>
            <span class="image featured">
                {% image self.header_image fill-800x450 as header_image %}
                <img alt="{{ self.header_image.title }}" src="{{ header_image.url }}">
            </span>
        </section>
        <section>
            {{ self.body|richtext}}
        </section>
        {% show_comments %}
    </article>
{% endblock content %}

{% block extra_content %}
    {% if self.has_related %}
        {% include 'puput/related_entries.html' with entry=self %}
    {% endif %}
{% endblock extra_content %}
