You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
106 lines
4.3 KiB
HTML
106 lines
4.3 KiB
HTML
{% macro content(page) %}
|
|
|
|
{% set separator = config.extra.separator | default(value="•") %}
|
|
|
|
<main>
|
|
<article>
|
|
<div class="article-title">
|
|
{{ page.title }}
|
|
</div>
|
|
|
|
<ul class="meta">
|
|
{% if page.draft %}
|
|
<li class="draft-label">{%- if lang != config.default_language %} {{ trans(key="draft" | safe, lang=lang) }} {% else %} DRAFT {% endif %}</li>
|
|
{% endif %}
|
|
|
|
{% if page.date %}
|
|
<li>{{ macros_format_date::format_date(date=page.date, short=true) }} {{ separator }}</li>
|
|
{% endif %}
|
|
|
|
<li title="{{ page.word_count }} {%- if lang != config.default_language %} {{ trans(key="words" | safe, lang=lang) }} {% else %} words {% endif %}"> {{ page.reading_time }}{%- if lang != config.default_language %} {{ trans(key="min_read" | safe, lang=lang) }} {% else %} min read {% endif %}</li>
|
|
|
|
{% if page.taxonomies and page.taxonomies.tags %}
|
|
<li> {{ separator }} {%- if lang != config.default_language -%}{{ trans(key="tags" | safe, lang=lang) | capitalize }}{% else %}Tags{%- endif -%}: </li>
|
|
{% for tag in page.taxonomies.tags %}
|
|
<li><a href={{ get_taxonomy_url(kind='tags', name=tag, lang=lang) | safe }}>{{ tag }}</a>
|
|
{%- if not loop.last -%}
|
|
,
|
|
{%- endif -%}
|
|
</li>
|
|
{% endfor %}
|
|
{% endif %}
|
|
|
|
{% if page.updated %}
|
|
</ul><ul class="meta last-updated"><li>{%- if lang != config.default_language %} {{ trans(key="last_updated_on" | safe, lang=lang) }} {% else %} Last updated on {% endif %} {{ macros_format_date::format_date(date=page.updated, short=true) }}</li>
|
|
{% endif %}
|
|
</ul>
|
|
|
|
{% if page.extra.tldr %}
|
|
<div class="tldr">
|
|
<h3>TL;DR:</h3>
|
|
<p>{{ page.extra.tldr }}</p>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{# Optional table of contents #}
|
|
{% if page.extra.toc | default(value=false) %}
|
|
{% if page.toc %}
|
|
<div class="toc-container">
|
|
<h3>{%- if lang != config.default_language %} {{ trans(key="table_of_contents" | safe, lang=lang) }} {% else %} Table of Contents {% endif %}</h3>
|
|
<ul>
|
|
{% for h1 in page.toc %}
|
|
<li>
|
|
<a href="{{ h1.permalink | safe }}">{{ h1.title }}</a>
|
|
{% if h1.children %}
|
|
<ul>
|
|
{% for h2 in h1.children %}
|
|
<li>
|
|
<a href="{{ h2.permalink | safe }}">{{ h2.title }}</a>
|
|
{% if h2.children %}
|
|
<ul>
|
|
{% for h3 in h2.children %}
|
|
<li>
|
|
<a href="{{ h3.permalink | safe }}">{{ h3.title }}</a>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
<section class="body">
|
|
{{ page.content | safe }}
|
|
</section>
|
|
|
|
</article>
|
|
|
|
{# giscus / utterances comments #}
|
|
{% if config.extra.giscus.enabled_for_all_posts or page.extra.giscus %}
|
|
{# TODO: HERE GOES GISCUS SUPPORT #}
|
|
{% elif config.extra.utterances.enabled_for_all_posts or page.extra.utterances %}
|
|
<div class="comments">
|
|
<script src="https://utteranc.es/client.js"
|
|
repo="{{ config.extra.utterances.repo }}"
|
|
issue-term="{{ config.extra.utterances.issue_term }}"
|
|
label="{{ config.extra.utterances.label }}"
|
|
theme="{{ config.extra.utterances.theme }}"
|
|
{%- if config.extra.utterances.lazy_loading -%}
|
|
data-loading="lazy"
|
|
{%- endif -%}
|
|
crossorigin="anonymous"
|
|
async>
|
|
</script>
|
|
</div>
|
|
{% endif %}
|
|
</main>
|
|
|
|
{% endmacro content %}
|