mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-17 23:07:50 +00:00
Move macros
Each edition now has their own macros, so create a macros.html for the third edition too. Since the utterances theme differs between editions, we need to move it from snippets.html to the edition-specific macros.html too.
This commit is contained in:
@@ -26,43 +26,6 @@
|
||||
</div>
|
||||
{% endmacro post_link %}
|
||||
|
||||
{% macro post_link_edition_3(page) %}
|
||||
<div>
|
||||
{% set translations = page.translations | filter(attribute="lang", value=lang) -%}
|
||||
{%- if translations -%}
|
||||
{%- set post = get_page(path = translations.0.path) -%}
|
||||
{%- else -%}
|
||||
{%- set post = page -%}
|
||||
{%- set not_translated = true -%}
|
||||
{%- endif -%}
|
||||
<h3 class="post-list-title"><a href="{{ post.path | safe }}">{{ post.title }}</a></h3>
|
||||
<span class="post-list-icon">
|
||||
{%- if post.extra.icon -%}{{post.extra.icon | safe}}{%- endif -%}
|
||||
</span>
|
||||
<div class="post-summary">
|
||||
{{ post.summary | safe }}
|
||||
<a class="read-more" href="{{ post.path | safe }}"><em>read more »</em></a>
|
||||
|
||||
{%- if lang and not_translated and lang != config.default_language -%}
|
||||
<aside class="no-translation">
|
||||
(This post is not translated yet.)
|
||||
</aside>
|
||||
{%- endif -%}
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro post_link %}
|
||||
|
||||
|
||||
{% macro utterances_edition_3() %}
|
||||
<script src="https://utteranc.es/client.js"
|
||||
data-repo="phil-opp/blog_os"
|
||||
data-issue-term="url"
|
||||
data-label="comments"
|
||||
crossorigin="anonymous"
|
||||
theme="preferred-color-scheme"
|
||||
async>
|
||||
</script>
|
||||
{% endmacro utterances_edition_3 %}
|
||||
{% macro toc(toc) %}
|
||||
<details id = "toc-inline">
|
||||
<summary><b>Table of Contents</b></summary>
|
||||
@@ -79,3 +42,13 @@
|
||||
</ul>
|
||||
</details>
|
||||
{% endmacro toc %}
|
||||
|
||||
{% macro utterances() %}
|
||||
<script src="https://utteranc.es/client.js"
|
||||
data-repo="phil-opp/blog_os"
|
||||
data-issue-term="url"
|
||||
data-label="comments"
|
||||
crossorigin="anonymous"
|
||||
async>
|
||||
</script>
|
||||
{% endmacro utterances %}
|
||||
|
||||
Reference in New Issue
Block a user