{% extends "./base.html" %}
{% load i18n %}
{% load static %}

{% load wagtailcore_tags %}
{% load wagtailimages_tags %}

{% if comments_are_enabled %}
  {% load comments %}
{% endif %}

{% block css %}
  {{ block.super }}
  {% if comments_are_enabled %}
    <link rel="stylesheet" type="text/css" href="{% static 'fluent_comments/css/ajaxcomments.css' %}" />
  {% endif %}
{% endblock css %}

{% block meta %}
  {{ block.super }}
  {% block social_meta %}
    <!-- twitter card / opengraph -->
    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:title" content="{{ page.seo_title }}">
    <meta name="twitter:image" content="{{ social_cover_image_url }}">
    <meta name="twitter:image:alt" content="{{ cover_alt_text }}">
    <meta name="twitter:description" content="{{ page.search_description }}">

    <meta property="og:url" content="{{ page_url }}">
    <meta property="og:title" content="{{ page.seo_title }}">
    <meta property="og:image" content="{{ social_cover_image_url }}">
    <meta property="og:image:alt" content="{{ cover_alt_text }}">
    {% if social_cover_image_url %}
      <meta property="og:image:width" content="{{ social_cover_image_width }}">
      <meta property="og:image:height" content="{{ social_cover_image_height }}">
    {% endif %}
    <meta property="og:type" content="article">
    <meta property="og:description" content="{{ page.search_description }}">
    <meta property="og:updated_time" content="{{ updated_timestamp }}">
  {% endblock social_meta %}
{% endblock meta %}

{% block robots %}
  {% if blog.noindex %}
    <meta name="robots" content="noindex, nofollow">
  {% else %}
    <meta name="robots" content="index, follow">
  {% endif %}
{% endblock robots %}

{% block title %}{{ page.title }}{% endblock title %}

{% block main %}
  {% include "./post_body.html" with render_detail=True %}

  {% if comments_are_enabled %}
    {% render_comment_list for page %}
    {% render_comment_form for page %}
  {% endif %}

  <p><a href="{{ page.get_parent.url }}">Return to blog</a></p>

{% endblock %}

{% block javascript %}
  {{ block.super }}
  {% if comments_are_enabled %}
    <script defer type="text/javascript" src="{% static 'fluent_comments/js/ajaxcomments.js' %}"></script>
  {% endif %}
{% endblock javascript %}
