{% capture date %}{{ page.date }}{{ post.date }}{% endcapture %}
{% capture date_formatted %}{{ page.date | date:"%d.%m.%Y" }}{{ post.date | date:"%d.%m.%Y" }}{% endcapture %}
{% capture has_date %}{{ date | size }}{% endcapture %}

{% capture updated %}{{ page.updated }}{{ post.updated }}{% endcapture %}
{% capture updated_formatted %}{{ page.updated | date:"%d.%m.%Y" }}{{ post.updated | date:"%d.%m.%Y" }}{% endcapture %}
{% capture was_updated %}{{ updated | size }}{% endcapture %}

{% if has_date != '0' %}
  {% capture time %}
    {% if page.language == "en" %}
      <span class="published"><svg class="meta-icon"><use xlink:href="#calendar"></use></svg> <em>Published on</em> <time datetime="{{ date | datetime | date_to_xmlschema }}" pubdate{% if updated %} data-updated="true"{% endif %}>{{ date_formatted }}</time></span>
    {% else %}
      <span class="published"><svg class="meta-icon"><use xlink:href="#calendar"></use></svg> <em>Veröffentlicht am</em> <time datetime="{{ date | datetime | date_to_xmlschema }}" pubdate{% if updated %} data-updated="true"{% endif %}>{{ date_formatted }}</time></span>
    {% endif %}
  {% endcapture %}
{% endif %}

{% if was_updated != '0' %}
  {% capture updated %}
    {% if page.language == "en" %}
      <span class="updated"><svg class="meta-icon"><use xlink:href="#calendar"></use></svg> <em>Edited on</em> <time datetime="{{ updated | datetime | date_to_xmlschema }}">{{ updated_formatted }}</time></span>
    {% else %}
      <span class="updated"><svg class="meta-icon"><use xlink:href="#calendar"></use></svg> <em>Bearbeitet am</em> <time datetime="{{ updated | datetime | date_to_xmlschema }}">{{ updated_formatted }}</time></span>
    {% endif %}
  {% endcapture %}
{% else %}{% assign updated = false %}{% endif %}
