mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
44 lines
1.5 KiB
HTML
44 lines
1.5 KiB
HTML
{% macro post_link(page) %}
|
|
<div>
|
|
<h2 class="post-title"><a href="/{{ page.path | safe }}">{{ page.title }}</a></h2>
|
|
<div class="post-summary">
|
|
{{ page.summary | safe}}
|
|
<a class="read-more" href="/{{ page.path | safe }}">read more…</a>
|
|
|
|
{% set translations = page.translations | filter(attribute="lang", value=lang) %}
|
|
{% if translations %}
|
|
<div class="post-translation">
|
|
{% set post = translations.0 %}
|
|
<b>Community Translation: <a href="{{ post.permalink }}">{{ post.title }}</a></b>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endmacro post_link %}
|
|
|
|
{% macro utterances() %}
|
|
<script src="https://utteranc.es/client.js"
|
|
repo="phil-opp/blog_os"
|
|
issue-term="url"
|
|
label="comments"
|
|
crossorigin="anonymous"
|
|
async>
|
|
</script>
|
|
{% endmacro utterances %}
|
|
|
|
{% macro toc(toc) %}
|
|
<details id = "toc-inline">
|
|
<summary><b>Table of Contents</b></summary>
|
|
<ul>
|
|
{% for h2 in toc %}<li>
|
|
<a href="#{{h2.id | safe}}">{{ h2.title | safe }}</a>
|
|
{% if h2.children %}<ul>
|
|
{% for h3 in h2.children %}<li>
|
|
<a href="#{{h3.id | safe}}">{{ h3.title | safe }}</a>
|
|
</li>{% endfor %}
|
|
</ul>{% endif %}
|
|
</li>{% endfor %}
|
|
</ul>
|
|
</details>
|
|
{% endmacro toc %}
|