init
This commit is contained in:
commit
d013ece0f3
363 changed files with 20823 additions and 0 deletions
20
themes/duckquill/templates/404.html
Normal file
20
themes/duckquill/templates/404.html
Normal file
|
@ -0,0 +1,20 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
{%- set rel_attributes = macros_rel_attributes::rel_attributes() | trim -%}
|
||||
<picture>
|
||||
<source srcset="{{ get_url(path='404.png') }}" media="(prefers-reduced-motion: reduce)"></source>
|
||||
<img id="not-found" class="pixels transparent no-hover" alt="404" {%- if config.markdown.lazy_async_image -%}decoding="async" loading="lazy"{%- endif -%} src="{{ get_url(path='404.gif') }}">
|
||||
</picture>
|
||||
|
||||
<h1>Page Not Found</h1>
|
||||
|
||||
<p>The requested page could not be found.{% if config.extra.issues_url %} If you feel this is not normal, then you can create an issue on the issue tracker.{% endif %}</p>
|
||||
|
||||
<div class="buttons">
|
||||
<a href="{{ get_url(path='/', lang=lang) }}">Go Home</a>
|
||||
{%- if config.extra.issues_url %}
|
||||
<a class="colored external" href="{{ config.extra.issues_url }}" rel="{{ rel_attributes }}">File an Issue</a>
|
||||
{%- endif %}
|
||||
</div>
|
||||
{% endblock content %}
|
1
themes/duckquill/templates/anchor-link.html
Normal file
1
themes/duckquill/templates/anchor-link.html
Normal file
|
@ -0,0 +1 @@
|
|||
<a class="zola-anchor" href="#{{ id }}" aria-label="Anchor link for: {{ id }}"><i class="icon"></i></a>
|
158
themes/duckquill/templates/article.html
Normal file
158
themes/duckquill/templates/article.html
Normal file
|
@ -0,0 +1,158 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
{%- set date_format = macros_translate::translate(key="date_format", default="%B %d, %Y", language_strings=language_strings) -%}
|
||||
{%- set date_locale = macros_translate::translate(key="date_locale", default="en_US", language_strings=language_strings) -%}
|
||||
{%- set rel_attributes = macros_rel_attributes::rel_attributes() | trim -%}
|
||||
|
||||
{%- if page.extra.toc_ordered or section.extra.toc_ordered or config.extra.toc_ordered -%}
|
||||
{%- set list_element = "ol" -%}
|
||||
{%- else -%}
|
||||
{%- set list_element = "ul" -%}
|
||||
{%- endif -%}
|
||||
|
||||
<article>
|
||||
{%- if page.extra.banner -%}
|
||||
<div id="banner-container">
|
||||
<img id="banner" class="full-bleed{% if page.extra.banner_pixels %} pixels{% endif %}" src="{{ current_url ~ page.extra.banner }}" {% if config.markdown.lazy_async_image %}decoding="async" loading="lazy"{% endif %} />
|
||||
</div>
|
||||
{%- endif -%}
|
||||
|
||||
<div id="heading">
|
||||
{%- if page.date -%}
|
||||
<p>
|
||||
<small>
|
||||
<time datetime="{{ page.date | date(format=' %+') }}">
|
||||
{{- macros_translate::translate(key="published", default="Published on", language_strings=language_strings) }}
|
||||
{{ page.date | date(format=date_format, locale=date_locale) -}}
|
||||
</time>
|
||||
{%- if page.updated -%}
|
||||
<span> {{ config.extra.separator | default(value="•") }} </span>
|
||||
<time datetime="{{ page.updated | date(format=' %+') }}">
|
||||
{{- macros_translate::translate(key="updated", default="Updated on", language_strings=language_strings) }}
|
||||
{{ page.updated | date(format=date_format, locale=date_locale) -}}
|
||||
</time>
|
||||
{%- endif -%}
|
||||
</small>
|
||||
</p>
|
||||
{%- endif -%}
|
||||
|
||||
<h1>{{ page.title }}</h1>
|
||||
|
||||
{%- if page.authors or config.extra.show_reading_time -%}
|
||||
<p>
|
||||
<small>
|
||||
{%- if page.authors -%}
|
||||
<span>{% include "partials/authors.html" -%}</span>
|
||||
{%- if config.extra.show_reading_time -%}
|
||||
<span> {{ config.extra.separator | default(value="•") }} </span>
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- if config.extra.show_reading_time -%}
|
||||
<span>{{ macros_translate::translate(key="minutes_read", number=page.reading_time, default="$NUMBER minute read", language_strings=language_strings) }}</span>
|
||||
{%- if page.taxonomies -%}
|
||||
<span> {{ config.extra.separator | default(value="•") }} </span>
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
</small>
|
||||
</p>
|
||||
{%- endif -%}
|
||||
|
||||
{%- if page.taxonomies -%}
|
||||
{%- for name, taxon in page.taxonomies %}
|
||||
<ul class="tags">
|
||||
{%-for item in taxon -%}
|
||||
<li><a class="tag" href="{{ get_taxonomy_url(kind=name, name=item, lang=lang) }}">{{ item }}</a></li>
|
||||
{%- endfor %}
|
||||
</ul>
|
||||
{%- endfor -%}
|
||||
{%- endif %}
|
||||
</div>
|
||||
|
||||
<div id="buttons-container">
|
||||
{%- if page.extra.toc and page.toc | length > 0 -%}
|
||||
<details id="toc" class="closable">
|
||||
<summary title="{{ macros_translate::translate(key='table_of_contents', default='Table of Contents', language_strings=language_strings) }}"><i class="icon"></i></summary>
|
||||
<div>
|
||||
<strong class="title">{{ macros_translate::translate(key="table_of_contents", default="Table of Contents", language_strings=language_strings) }}</strong>
|
||||
<div>
|
||||
<{{ list_element }}>
|
||||
{%- for h1 in page.toc -%}
|
||||
<li>
|
||||
<a href="{{ h1.permalink | safe }}">{{ h1.title }}</a>
|
||||
{%- if h1.children -%}
|
||||
<{{ list_element }}>
|
||||
{%- for h2 in h1.children -%}
|
||||
<li>
|
||||
<a href="{{ h2.permalink | safe }}">{{ h2.title }}</a>
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
</{{ list_element }}>
|
||||
{%- endif -%}
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
</{{ list_element }}>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
{%- endif -%}
|
||||
{%- if config.extra.show_backlinks and page.backlinks | length > 0 -%}
|
||||
<details id="backlinks" class="closable">
|
||||
<summary title="{{ macros_translate::translate(key='backlinks', default='Backlinks', language_strings=language_strings) }}"><i class="icon"></i></summary>
|
||||
<div>
|
||||
<strong class="title">{{ macros_translate::translate(key="backlinks", default="Backlinks", language_strings=language_strings) }}</strong>
|
||||
<div>
|
||||
<ul>
|
||||
{%- for backlink in page.backlinks -%}
|
||||
<li>
|
||||
<a href="{{ backlink.permalink }}">{{ backlink.title }}</a>
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
{%- endif -%}
|
||||
<a id="go-to-top" href="#top" title="{{ macros_translate::translate(key='go_to_top', default='Go to Top', language_strings=language_strings) }}"><i class="icon"></i></a>
|
||||
{%- if config.extra.show_share_button -%}
|
||||
<a id="share" href="https://shareopenly.org/share/?url={{ page.permalink }}{% if page.description %}&text={{ page.description | urlencode }}{% endif %}" rel="{{ rel_attributes }}" title="{{ macros_translate::translate(key='share', default='Share', language_strings=language_strings) }}"><i class="icon"></i></a>
|
||||
{%- endif -%}
|
||||
{%- if config.extra.issues_url -%}
|
||||
<a id="issue" href="{{ config.extra.issues_url }}" rel="{{ rel_attributes }}" title="{{ macros_translate::translate(key='file_an_issue', default='File an Issue', language_strings=language_strings) }}"><i class="icon"></i></a>
|
||||
{%- endif -%}
|
||||
</div>
|
||||
|
||||
{%- include "partials/statements.html" -%}
|
||||
|
||||
{%- if page.extra.toc_inline -%}
|
||||
{%- include "partials/toc.html" -%}
|
||||
{%- elif config.extra.toc_inline -%}
|
||||
{%- include "partials/toc.html" -%}
|
||||
{%- endif -%}
|
||||
|
||||
{{ page.content | safe }}
|
||||
</article>
|
||||
|
||||
{%- if page.extra.comments.id -%}
|
||||
{%- include "partials/comments.html" -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- if page.lower or page.higher -%}
|
||||
<hr />
|
||||
<nav id="post-nav">
|
||||
{%- if page.higher -%}
|
||||
<a class="post-nav-item post-nav-prev" href="{{ page.higher.permalink }}">
|
||||
<div class="nav-arrow">{{ macros_translate::translate(key="previous", default="Previous", language_strings=language_strings) }}</div>
|
||||
<span class="post-title">{{ page.higher.title }}</span>
|
||||
</a>
|
||||
{%- endif -%}
|
||||
{%- if page.lower -%}
|
||||
<a class="post-nav-item post-nav-next" href="{{ page.lower.permalink }}">
|
||||
<div class="nav-arrow">{{ macros_translate::translate(key="next", default="Next", language_strings=language_strings) }}</div>
|
||||
<span class="post-title">{{ page.lower.title }}</span>
|
||||
</a>
|
||||
{%- endif -%}
|
||||
</nav>
|
||||
{%- endif -%}
|
||||
{% endblock content %}
|
92
themes/duckquill/templates/article_list.html
Normal file
92
themes/duckquill/templates/article_list.html
Normal file
|
@ -0,0 +1,92 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
{%- set date_format = macros_translate::translate(key="date_format", default="%B %d, %Y", language_strings=language_strings) -%}
|
||||
{%- set date_locale = macros_translate::translate(key="date_locale", default="en_US", language_strings=language_strings) -%}
|
||||
|
||||
{%- if paginator.pages -%}
|
||||
{%- set number_of_posts = paginator.total_pages -%}
|
||||
{%- elif section.pages -%}
|
||||
{%- set number_of_posts = section.pages | length -%}
|
||||
{%- endif -%}
|
||||
|
||||
<h1>{{ section.title }}</h1>
|
||||
|
||||
{{ section.content | safe }}
|
||||
|
||||
{# <div class="sparkline">
|
||||
{%- if paginator.pages -%}
|
||||
{%- set pages = paginator.pages -%}
|
||||
{%- elif section.pages -%}
|
||||
{%- set pages = section.pages -%}
|
||||
{%- else -%}
|
||||
{%- set pages = term.pages -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- for month, pages in pages | group_by(attribute="month") -%}
|
||||
{%- set posts_per_bar = pages | length -%}
|
||||
{%- set bar_height = pages | length * 10 -%}
|
||||
<div style="--bar-height: {{ bar_height ~ '%' }}" title="{{ macros_translate::translate(key='posts', number=posts_per_bar, default='$NUMBER posts in total', language_strings=language_strings) }}"></div>
|
||||
{%- endfor -%}
|
||||
</div> #}
|
||||
|
||||
<p>
|
||||
<small>
|
||||
{%- if config.taxonomies | length > 0 -%}
|
||||
<a href="{{ get_url(path='tags', lang=lang) }}">
|
||||
{{ macros_translate::translate(key="filter_by_tag", default="Filter by tag", language_strings=language_strings) }}
|
||||
</a>
|
||||
<br />
|
||||
{%- endif %}
|
||||
{{ macros_translate::translate(key="posts", number=number_of_posts, default="$NUMBER posts in total", language_strings=language_strings) }}
|
||||
</small>
|
||||
</p>
|
||||
|
||||
{% include "partials/articles.html" %}
|
||||
|
||||
{%- if paginator.pages -%}
|
||||
<nav id="paginator">
|
||||
{%- if paginator.first != current_url -%}
|
||||
<a id="paginator-first" href="{{ paginator.first }}" title="{{ macros_translate::translate(key='first', default='First', language_strings=language_strings) }}">
|
||||
<i class="icon"></i>
|
||||
</a>
|
||||
{% else %}
|
||||
<span id="paginator-first" title="{{ macros_translate::translate(key='first', default='First', language_strings=language_strings) }}">
|
||||
<i class="icon"></i>
|
||||
</span>
|
||||
{%- endif -%}
|
||||
|
||||
{%- if paginator.previous -%}
|
||||
<a id="paginator-previous" href="{{ paginator.previous }}" title="{{ macros_translate::translate(key='previous', default='Previous', language_strings=language_strings) }}">
|
||||
<i class="icon"></i>
|
||||
</a>
|
||||
{% else %}
|
||||
<span id="paginator-previous" title="{{ macros_translate::translate(key='previous', default='Previous', language_strings=language_strings) }}">
|
||||
<i class="icon"></i>
|
||||
</span>
|
||||
{%- endif -%}
|
||||
|
||||
<span id="paginator-counter">{{ paginator.current_index }}/{{ paginator.number_pagers }}</span>
|
||||
|
||||
{%- if paginator.next -%}
|
||||
<a id="paginator-next" href="{{ paginator.next }}" title="{{ macros_translate::translate(key='next', default='Next', language_strings=language_strings) }}">
|
||||
<i class="icon"></i>
|
||||
</a>
|
||||
{%- else -%}
|
||||
<span id="paginator-next" title="{{ macros_translate::translate(key='next', default='Next', language_strings=language_strings) }}">
|
||||
<i class="icon"></i>
|
||||
</span>
|
||||
{%- endif -%}
|
||||
|
||||
{%- if paginator.last != current_url -%}
|
||||
<a id="paginator-last" href="{{ paginator.last }}" title="{{ macros_translate::translate(key='last', default='Last', language_strings=language_strings) }}">
|
||||
<i class="icon"></i>
|
||||
</a>
|
||||
{% else %}
|
||||
<span id="paginator-last" title="{{ macros_translate::translate(key='last', default='Last', language_strings=language_strings) }}">
|
||||
<i class="icon"></i>
|
||||
</span>
|
||||
{%- endif -%}
|
||||
</nav>
|
||||
{%- endif -%}
|
||||
{% endblock content %}
|
38
themes/duckquill/templates/base.html
Normal file
38
themes/duckquill/templates/base.html
Normal file
|
@ -0,0 +1,38 @@
|
|||
{% import "macros/rel_attributes.html" as macros_rel_attributes %}
|
||||
{% import "macros/translate.html" as macros_translate %}
|
||||
|
||||
{%- set language_strings = load_data(path="i18n/" ~ lang ~ '.toml', required=false) -%}
|
||||
{%- if not language_strings -%}
|
||||
{%- set language_strings = load_data(path="themes/duckquill/i18n/" ~ lang ~ ".toml", required=false) -%}
|
||||
{%- endif -%}
|
||||
{%- set rtl_languages = ["ar", "arc", "az", "dv", "ff", "he", "ku", "nqo", "fa", "rhg", "syc", "ur"] -%}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" {% if lang in rtl_languages %}dir="rtl"{% endif %} lang="{{ lang }}" {% include "partials/default_theme.html" %}>
|
||||
{% include "partials/head.html" %}
|
||||
<body>
|
||||
{% block body %}
|
||||
{%- if config.extra.nav.links %}
|
||||
{% include "partials/nav.html" %}
|
||||
{%- endif %}
|
||||
{%- if page.extra.toc_sidebar or section.extra.toc_sidebar -%}
|
||||
<div id="sidebar">
|
||||
<div>
|
||||
{%- include "partials/toc.html" -%}
|
||||
</div>
|
||||
</div>
|
||||
{%- endif -%}
|
||||
<main id="main-content">
|
||||
{% block custom %}{% endblock custom %}
|
||||
{%- if page.extra.go_to_top or section.extra.go_to_top -%}
|
||||
<div id="buttons-container">
|
||||
<a id="go-to-top" href="#top" title="{{ macros_translate::translate(key='go_to_top', default='Go to Top', language_strings=language_strings) }}"><i class="icon"></i></a>
|
||||
</div>
|
||||
{%- endif -%}
|
||||
{% block content %}{% endblock content %}
|
||||
{% include "partials/extra_features.html" %}
|
||||
</main>
|
||||
{% include "partials/footer.html" %}
|
||||
{% endblock body %}
|
||||
</body>
|
||||
</html>
|
5
themes/duckquill/templates/index.html
Normal file
5
themes/duckquill/templates/index.html
Normal file
|
@ -0,0 +1,5 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
{{ section.content | safe }}
|
||||
{% endblock content %}
|
19
themes/duckquill/templates/macros/rel_attributes.html
Normal file
19
themes/duckquill/templates/macros/rel_attributes.html
Normal file
|
@ -0,0 +1,19 @@
|
|||
{#- Taken from https://github.com/welpo/tabi/blob/7b00ed1d9dca5c529d2816c5b6679bfe600d63fc/templates/macros/rel_attributes.html -#}
|
||||
|
||||
{% macro rel_attributes() %}
|
||||
|
||||
{%- set rel_attributes = [] -%}
|
||||
{%- if config.markdown.external_links_target_blank -%}
|
||||
{%- set rel_attributes = rel_attributes | concat(with="noopener") -%}
|
||||
{%- endif -%}
|
||||
{%- if config.markdown.external_links_no_follow -%}
|
||||
{%- set rel_attributes = rel_attributes | concat(with="nofollow") -%}
|
||||
{%- endif -%}
|
||||
{%- if config.markdown.external_links_no_referrer -%}
|
||||
{%- set rel_attributes = rel_attributes | concat(with="noreferrer") -%}
|
||||
{%- endif -%}
|
||||
|
||||
{# Return the array of rel attributes joined by a space #}
|
||||
{{- rel_attributes | join(sep=" ") -}}
|
||||
|
||||
{% endmacro rel_attributes %}
|
74
themes/duckquill/templates/macros/translate.html
Normal file
74
themes/duckquill/templates/macros/translate.html
Normal file
|
@ -0,0 +1,74 @@
|
|||
{#- Taken from https://github.com/welpo/tabi/blob/7b00ed1d9dca5c529d2816c5b6679bfe600d63fc/templates/macros/translate.html -#}
|
||||
|
||||
{#- Dynamically selects the appropriate translation key based on the provided `number` and `lang` context.
|
||||
If a `number` is provided, the macro will attempt to pluralize the translation key based on the language's rules.
|
||||
|
||||
Parameters:
|
||||
- `key`: The base key for the translation string, matching the i18n files. Example: `results` to get `zero_results`, `one_results`, `many_results`, etc.
|
||||
- `number`: Optional. The numerical value associated with the key.
|
||||
- `language_strings`: A dictionary containing the translation strings.
|
||||
- `default`: A default string to use if no translation is found for the key.
|
||||
- `replace`: Optional. If `true`, the macro will replace the `$NUMBER` placeholder in the translation string with the provided `number`.
|
||||
|
||||
The macro supports special pluralization rules for:
|
||||
- Arabic (`ar`): Has unique forms for zero, one, two, few, and many.
|
||||
- Slavic languages: Pluralization depends on the last digit of the number, with exceptions for numbers ending in 11-14.
|
||||
|
||||
NOTE: If the logic for pluralization is modified, it needs to be replicated on the JavaScript search.
|
||||
Files: static/js/searchElasticlunr.js and its minified version at static/js/searchElasticlunr.min.js
|
||||
Function name: getPluralizationKey -#}
|
||||
{% macro translate(key, number=-1, language_strings="", default="", replace=true) %}
|
||||
{%- set slavic_plural_languages = ["uk", "be", "bs", "hr", "ru", "sr"] -%}
|
||||
|
||||
{%- set key_prefix = "" -%}
|
||||
{#- `zero_` and `one_` are common cases. We handle "many" (plural) later, after language-specific pluralization -#}
|
||||
{%- if number == 0 -%}
|
||||
{%- set key_prefix = "zero_" -%}
|
||||
{%- elif number == 1 -%}
|
||||
{%- set key_prefix = "one_" -%}
|
||||
{%- endif -%}
|
||||
|
||||
{#- Pluralization -#}
|
||||
{%- if number != -1 and key_prefix == "" -%}
|
||||
{#- Arabic -#}
|
||||
{%- if lang == "ar" -%}
|
||||
{%- set modulo = number % 100 -%}
|
||||
{%- if number == 2 -%}
|
||||
{%- set key_prefix = "two_" -%}
|
||||
{%- elif modulo >= 3 and modulo <= 10 -%}
|
||||
{%- set key_prefix = "few_" -%}
|
||||
{%- else -%}
|
||||
{%- set key_prefix = "many_" -%}
|
||||
{%- endif -%}
|
||||
{#- Slavic languages like Russian or Ukrainian -#}
|
||||
{%- elif lang in slavic_plural_languages -%}
|
||||
{%- set modulo10 = number % 10 -%}
|
||||
{%- set modulo100 = number % 100 -%}
|
||||
{%- if modulo10 == 1 and modulo100 != 11 -%}
|
||||
{%- set key_prefix = "one_" -%}
|
||||
{%- elif modulo10 >= 2 and modulo10 <= 4 -%}
|
||||
{%- if modulo100 >= 12 and modulo100 <= 14 -%}
|
||||
{%- set key_prefix = "many_" -%}
|
||||
{%- else -%}
|
||||
{%- set key_prefix = "few_" -%}
|
||||
{%- endif -%}
|
||||
{%- else -%}
|
||||
{%- set key_prefix = "many_" -%}
|
||||
{%- endif -%}
|
||||
{%- else -%}
|
||||
{#- Default pluralization -#}
|
||||
{#- Zero and one are already handled -#}
|
||||
{%- set key_prefix = "many_" -%}
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
|
||||
{#- Translated string -#}
|
||||
{%- set final_key = key_prefix ~ key -%}
|
||||
{%- set translated_text = language_strings[final_key] | default(value=default) | safe -%}
|
||||
|
||||
{#- Replace $NUMBER with the number -#}
|
||||
{%- if replace -%}
|
||||
{%- set translated_text = translated_text | replace(from="$NUMBER", to=number | as_str) -%}
|
||||
{%- endif -%}
|
||||
{{- translated_text -}}
|
||||
{% endmacro translate %}
|
10
themes/duckquill/templates/page.html
Normal file
10
themes/duckquill/templates/page.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{{ page.title }}</h1>
|
||||
{%- include "partials/statements.html" -%}
|
||||
{%- if page.extra.toc and not page.extra.toc_sidebar -%}
|
||||
{%- include "partials/toc.html" -%}
|
||||
{%- endif -%}
|
||||
{{ page.content | safe }}
|
||||
{% endblock content %}
|
67
themes/duckquill/templates/partials/articles.html
Normal file
67
themes/duckquill/templates/partials/articles.html
Normal file
|
@ -0,0 +1,67 @@
|
|||
{%- if paginator.pages -%}
|
||||
{%- set pages = paginator.pages -%}
|
||||
{%- elif section.pages -%}
|
||||
{%- set pages = section.pages -%}
|
||||
{%- else -%}
|
||||
{%- set pages = term.pages -%}
|
||||
{%- endif -%}
|
||||
|
||||
<div id="article-list">
|
||||
{%- for page in pages %}
|
||||
{%- if page.draft -%}
|
||||
{%- set article_type = "draft" -%}
|
||||
{%- set article_string = macros_translate::translate(key="drafted", default="Drafted", language_strings=language_strings) -%}
|
||||
{%- elif page.extra.archive -%}
|
||||
{%- set article_type = "archive" -%}
|
||||
{%- set article_string = macros_translate::translate(key="archived", default="Archived", language_strings=language_strings) -%}
|
||||
{%- elif page.extra.featured -%}
|
||||
{%- set article_type = "featured" -%}
|
||||
{%- set article_string = macros_translate::translate(key="featured", default="Featured", language_strings=language_strings) -%}
|
||||
{%- elif page.extra.hot -%}
|
||||
{%- set article_type = "hot" -%}
|
||||
{%- set article_string = macros_translate::translate(key="hot", default="Hot", language_strings=language_strings) -%}
|
||||
{%- elif page.extra.poor -%}
|
||||
{%- set article_type = "poor" -%}
|
||||
{%- set article_string = macros_translate::translate(key="poor", default="Poor", language_strings=language_strings) -%}
|
||||
{%- endif -%}
|
||||
{%- if page.extra.banner -%}
|
||||
{%- set blurnail = resize_image(path=page.colocated_path ~ page.extra.banner, width=4, height=2, op="fill", format="webp") -%}
|
||||
{%- endif -%}
|
||||
<article {% if article_type %}class="{{ article_type }}"{% endif %} {% if blurnail %}style="--blurnail: url('{{ blurnail.url }}')"{% endif %}>
|
||||
<a href="{{ page.permalink | safe }}"></a>
|
||||
{% if article_type %}
|
||||
<span class="badge">
|
||||
<i class="icon"></i>
|
||||
{{- article_string -}}
|
||||
</span>
|
||||
{%- endif %}
|
||||
<h3>{{ page.title }}</h3>
|
||||
{%- if page.description %}
|
||||
{{ page.description | markdown | safe }}
|
||||
{%- endif %}
|
||||
{%- if page.date -%}
|
||||
<div class="details">
|
||||
<small>
|
||||
<time datetime="{{ page.date | date(format='%+') }}" pubdate>
|
||||
{{- page.date | date(format=date_format, locale=date_locale) -}}
|
||||
</time>
|
||||
{%- if page.authors -%}
|
||||
<span> {{ config.extra.separator | default(value="•") }} {% include "partials/authors.html" -%}</span>
|
||||
{%- endif -%}
|
||||
</small>
|
||||
{%- if page.taxonomies -%}
|
||||
{%- for name, taxon in page.taxonomies %}
|
||||
<small>
|
||||
<ul class="tags">
|
||||
{%-for item in taxon -%}
|
||||
<li><a class="tag" href="{{ get_taxonomy_url(kind=name, name=item, lang=lang) }}">{{ item }}</a></li>
|
||||
{%- endfor %}
|
||||
</ul>
|
||||
</small>
|
||||
{%- endfor -%}
|
||||
{%- endif %}
|
||||
</div>
|
||||
{%- endif -%}
|
||||
</article>
|
||||
{%- endfor %}
|
||||
</div>
|
14
themes/duckquill/templates/partials/authors.html
Normal file
14
themes/duckquill/templates/partials/authors.html
Normal file
|
@ -0,0 +1,14 @@
|
|||
{%- set author_list = page.authors -%}
|
||||
{%- if author_list | length == 1 -%}
|
||||
{%- set author_string = author_list.0 -%}
|
||||
{%- else -%}
|
||||
{%- set last_author = author_list | last -%}
|
||||
{%- set other_authors = author_list | slice(end=-1) -%}
|
||||
{%- set author_separator = macros_translate::translate(key="author_separator", default=", ", language_strings=language_strings) -%}
|
||||
{%- set conjunction = macros_translate::translate(key="author_conjunction", default=" and ", language_strings=language_strings) -%}
|
||||
{%- set author_string = other_authors | join(sep=author_separator) -%}
|
||||
{%- set author_string = author_string ~ conjunction ~ last_author -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- set by_author = macros_translate::translate(key="by_author", default="By $AUTHOR", language_strings=language_strings) -%}
|
||||
{{- by_author | replace(from="$AUTHOR", to=author_string) -}}
|
10
themes/duckquill/templates/partials/card.html
Normal file
10
themes/duckquill/templates/partials/card.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
{%- if page.extra.card -%}
|
||||
{{ get_url(path=page.colocated_path ~ page.extra.card) }}
|
||||
{%- elif section.extra.card -%}
|
||||
{{ get_url(path=section.colocated_path ~ section.extra.card) }}
|
||||
{%- elif page.extra.banner -%}
|
||||
{%- set card = resize_image(path=page.colocated_path ~ page.extra.banner, width=1200, height=628, op="fill") -%}
|
||||
{{ card.url }}
|
||||
{%- else -%}
|
||||
{{ get_url(path="card.png") }}
|
||||
{%- endif -%}
|
63
themes/duckquill/templates/partials/comments.html
Normal file
63
themes/duckquill/templates/partials/comments.html
Normal file
|
@ -0,0 +1,63 @@
|
|||
{%- if page.extra.comments.host -%}
|
||||
{%- set host = page.extra.comments.host -%}
|
||||
{%- else -%}
|
||||
{%- set host = config.extra.comments.host -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- if page.extra.comments.user -%}
|
||||
{%- set user = page.extra.comments.user -%}
|
||||
{%- else %}
|
||||
{%- set user = config.extra.comments.user -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- set id = page.extra.comments.id -%}
|
||||
|
||||
{%- set date_locale = macros_translate::translate(key="date_locale", default="en-US", language_strings=language_strings) | replace(from="_", to="-") -%}
|
||||
|
||||
<span id="blog-post-author-text" class="hidden">{{ macros_translate::translate(key="blog_post_author", default="Blog post author", language_strings=language_strings) }}</span>
|
||||
<span id="boosts-from-text" class="hidden">{{ macros_translate::translate(key="boosts_from", default="Boosts from $INSTANCE", language_strings=language_strings) }}</span>
|
||||
<span id="date-locale" class="hidden">{{ date_locale }}</span>
|
||||
<span id="faves-from-text" class="hidden">{{ macros_translate::translate(key="faves_from", default="Favorites from $INSTANCE", language_strings=language_strings) }}</span>
|
||||
<span id="host" class="hidden">{{ host }}</span>
|
||||
<span id="id" class="hidden">{{ id }}</span>
|
||||
<span id="loading-text" class="hidden">{{ macros_translate::translate(key="loading", default="Loading", language_strings=language_strings) }}…</span>
|
||||
<span id="no-comments-text" class="hidden">{{ macros_translate::translate(key="no_comments", default="No Comments yet :/", language_strings=language_strings) }}</span>
|
||||
<span id="rel-attributes" class="hidden">{{ rel_attributes }}</span>
|
||||
<span id="reload-text" class="hidden">{{ macros_translate::translate(key="reload", default="Reload", language_strings=language_strings) }}</span>
|
||||
<span id="sensitive-text" class="hidden">{{ macros_translate::translate(key="sensitive", default="Sensitive Content", language_strings=language_strings) }}</span>
|
||||
<span id="user" class="hidden">{{ user }}</span>
|
||||
<span id="view-comment-text" class="hidden">{{ macros_translate::translate(key="view_comment", default="View Comment At", language_strings=language_strings) }}</span>
|
||||
<span id="view-profile-text" class="hidden">{{ macros_translate::translate(key="view_profile", default="View Profile At", language_strings=language_strings) }}</span>
|
||||
|
||||
{%- if config.markdown.lazy_async_image %}
|
||||
<span id="lazy-async-image" class="hidden">true</span>
|
||||
{%- else -%}
|
||||
<span id="lazy-async-image" class="hidden">false</span>
|
||||
{%- endif %}
|
||||
|
||||
<section id="comments">
|
||||
{%- if config.extra.comments.show_qr -%}
|
||||
<img
|
||||
id="qrcode"
|
||||
class="pixels no-hover"
|
||||
title="{{ macros_translate::translate(key='comments_qr', default='QR code to a Mastodon post', language_strings=language_strings) }}"
|
||||
{%- if config.markdown.lazy_async_image -%}decoding="async" loading="lazy"{%- endif -%}
|
||||
src="https://api.qrserver.com/v1/create-qr-code/?data=https://{{ host }}/@{{ user }}/{{ id }}"
|
||||
/>
|
||||
{%- endif -%}
|
||||
<h2>{{ macros_translate::translate(key="comments", default="Comments", language_strings=language_strings) }}</h2>
|
||||
<p>{{ macros_translate::translate(key="comments_description", default="You can comment on this blog post by publicly replying to this post using a Mastodon or other ActivityPub/Fediverse account. Known non-private replies are displayed below.", language_strings=language_strings) }}</p>
|
||||
<div class="buttons">
|
||||
<button id="load-comments">
|
||||
{{- macros_translate::translate(key="load_comments", default="Load Comments", language_strings=language_strings) -}}
|
||||
</button>
|
||||
<a class="colored external" href="https://{{ host }}/@{{ user }}/{{ id }}" rel="{{ rel_attributes }}">
|
||||
{{- macros_translate::translate(key="open_post", default="Open Post", language_strings=language_strings) -}}
|
||||
</a>
|
||||
</div>
|
||||
<div id="comments-wrapper">
|
||||
<noscript>
|
||||
<p>{{ macros_translate::translate(key="comments_noscript", default="Loading comments relies on JavaScript. Try enabling JavaScript and reloading, or visit the original post on Mastodon.", language_strings=language_strings) }}</p>
|
||||
</noscript>
|
||||
</div>
|
||||
</section>
|
57
themes/duckquill/templates/partials/csp.html
Normal file
57
themes/duckquill/templates/partials/csp.html
Normal file
|
@ -0,0 +1,57 @@
|
|||
{#- Based on https://github.com/welpo/tabi/blob/7b00ed1d9dca5c529d2816c5b6679bfe600d63fc/templates/partials/content_security_policy.html -#}
|
||||
|
||||
<meta http-equiv="content-security-policy"
|
||||
content="default-src 'none';
|
||||
{%- if config.extra.csp -%}
|
||||
|
||||
{#- Initialise a base script-src directive -#}
|
||||
{%- set script_src = "script-src 'self'" -%}
|
||||
|
||||
{#- Initialise a base connect-src directive -#}
|
||||
{%- set connect_src = "connect-src 'self'" -%}
|
||||
|
||||
{# Base logic for appending analytics domains #}
|
||||
{%- if config.extra.goatcounter %}
|
||||
{%- set goatcounter_host = config.extra.goatcounter.host | default(value='goatcounter.com') -%}
|
||||
{%- set goatcounter_url = "https://" ~ config.extra.goatcounter.user ~ "." ~ goatcounter_host ~ "/count" %}
|
||||
{%- set script_src = script_src ~ " " ~ goatcounter_url -%}
|
||||
{%- set connect_src = connect_src ~ " " ~ goatcounter_url -%}
|
||||
{%- endif %}
|
||||
|
||||
|
||||
{#- Append comments host if present -#}
|
||||
{%- if config.extra.comments -%}
|
||||
{%- set connect_src = connect_src ~ " " ~ "https://" ~ config.extra.comments.host -%}
|
||||
{%- endif -%}
|
||||
|
||||
{#- Append WebSocket for Zola serve mode -#}
|
||||
{%- if config.mode == "serve" -%}
|
||||
{%- set connect_src = connect_src ~ " ws:" -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- for domain in config.extra.csp -%}
|
||||
{%- if domain.directive == "connect-src" -%}
|
||||
{%- set configured_connect_src = domain.domains | join(sep=' ') -%}
|
||||
{%- set_global connect_src = connect_src ~ " " ~ configured_connect_src -%}
|
||||
{%- continue -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- if domain.directive == "script-src" -%}
|
||||
{%- set configured_script_src = domain.domains | join(sep=' ') -%}
|
||||
{%- set_global script_src = script_src ~ " " ~ configured_script_src -%}
|
||||
{%- continue -%}
|
||||
{%- endif -%}
|
||||
|
||||
{#- Handle directives that are not connect-src -#}
|
||||
{{ domain.directive }} {{ domain.domains | join(sep=' ') -}}
|
||||
|
||||
{%- if not loop.last -%};{%- endif -%}
|
||||
{%- endfor -%}
|
||||
|
||||
{#- Insert the generated connect-src -#}
|
||||
{{ ";" ~ connect_src }}
|
||||
|
||||
{#- Insert the generated script-src -#}
|
||||
{{ ";" ~ script_src }}
|
||||
|
||||
{%- endif -%}" />
|
7
themes/duckquill/templates/partials/default_theme.html
Normal file
7
themes/duckquill/templates/partials/default_theme.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
{%- if page.extra.default_theme -%}
|
||||
data-theme="{{ page.extra.default_theme }}"
|
||||
{%- elif section.extra.default_theme -%}
|
||||
data-theme="{{ section.extra.default_theme }}"
|
||||
{%- elif config.extra.default_theme -%}
|
||||
data-theme="{{ config.extra.default_theme }}"
|
||||
{%- endif -%}
|
7
themes/duckquill/templates/partials/description.html
Normal file
7
themes/duckquill/templates/partials/description.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
{%- if page.description -%}
|
||||
{{- page.description }}
|
||||
{%- elif section.description -%}
|
||||
{{- section.description }}
|
||||
{%- else -%}
|
||||
{{- config.description -}}
|
||||
{%- endif -%}
|
8
themes/duckquill/templates/partials/extra_features.html
Normal file
8
themes/duckquill/templates/partials/extra_features.html
Normal file
|
@ -0,0 +1,8 @@
|
|||
{%- if config.extra.show_copy_button %}
|
||||
<span id="copy-code-text" class="hidden">{{ macros_translate::translate(key="copy_code", default="Copy Code", language_strings=language_strings) }}</span>
|
||||
{%- endif %}
|
||||
|
||||
{%- if config.build_search_index %}
|
||||
<span id="search-index" class="hidden">{{ get_url(path="/", lang=lang) }}/search_index.{{ config.default_language }}.json</span>
|
||||
<span id="more-matches-text" class="hidden">{{ macros_translate::translate(key="more_matches", default="$MATCHES more matches", language_strings=language_strings) }}</span>
|
||||
{%- endif %}
|
28
themes/duckquill/templates/partials/favicon.html
Normal file
28
themes/duckquill/templates/partials/favicon.html
Normal file
|
@ -0,0 +1,28 @@
|
|||
<link rel="icon" type="image/png" href="
|
||||
{%- if page.extra.favicon -%}
|
||||
{{ get_url(path=page.colocated_path ~ page.extra.favicon) }}
|
||||
{%- elif section.extra.favicon -%}
|
||||
{{ get_url(path=section.colocated_path ~ section.extra.favicon) }}
|
||||
{%- else -%}
|
||||
{{ get_url(path='favicon.png') }}
|
||||
{%- endif -%}" />
|
||||
|
||||
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="
|
||||
{%- if page.extra.apple_touch_icon -%}
|
||||
{{ get_url(path=page.colocated_path ~ page.extra.apple_touch_icon) }}
|
||||
{%- elif section.extra.apple_touch_icon -%}
|
||||
{{ get_url(path=section.colocated_path ~ section.extra.apple_touch_icon) }}
|
||||
{%- else -%}
|
||||
{{ get_url(path='apple-touch-icon.png') }}
|
||||
{%- endif -%}" />
|
||||
|
||||
{%- if page.extra.emoji_favicon or section.extra.emoji_favicon or config.extra.emoji_favicon %}
|
||||
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ctext x='-.07em' y='.89em' font-size='90'%3E
|
||||
{%- if page.extra.emoji_favicon -%}
|
||||
{{ page.extra.emoji_favicon | truncate(length=1, end='') }}
|
||||
{%- elif section.extra.emoji_favicon -%}
|
||||
{{ section.extra.emoji_favicon | truncate(length=1, end='') }}
|
||||
{%- else -%}
|
||||
{{ config.extra.emoji_favicon | truncate(length=1, end='') }}
|
||||
{%- endif -%}%3C/text%3E%3C/svg%3E">
|
||||
{%- endif %}
|
67
themes/duckquill/templates/partials/footer.html
Normal file
67
themes/duckquill/templates/partials/footer.html
Normal file
|
@ -0,0 +1,67 @@
|
|||
{%- set rel_attributes = macros_rel_attributes::rel_attributes() | trim -%}
|
||||
|
||||
<footer id="site-footer">
|
||||
{%- if config.extra.footer.links %}
|
||||
<nav>
|
||||
<ul>
|
||||
{%- for link in config.extra.footer.links %}
|
||||
{%- if link.url is matching('https?://') %}
|
||||
<li>
|
||||
<a href="{{ link.url }}" rel="{{ rel_attributes }}" class="external">
|
||||
{{- macros_translate::translate(key=link.name, default=link.name, language_strings=language_strings) -}}
|
||||
</a>
|
||||
</li>
|
||||
{%- else %}
|
||||
<li>
|
||||
<a href="{{ get_url(path=link.url, lang=lang)}}"
|
||||
{%- if current_url | default(value='/') | trim_end_matches(pat='/') | safe == get_url(path=link.url, lang=lang) | trim_end_matches(pat='/') | safe -%}
|
||||
class="active"
|
||||
{%- endif -%}>
|
||||
{{- macros_translate::translate(key=link.name, default=link.name, language_strings=language_strings) -}}
|
||||
</a>
|
||||
</li>
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
{%- endif %}
|
||||
|
||||
{%- if config.extra.footer.show_copyright %}
|
||||
{%- if config.extra.footer.copyright %}
|
||||
{{ config.extra.footer.copyright | markdown | safe }}
|
||||
{%- else %}
|
||||
<p>© {{ config.title }}, {{ now() | date(format="%Y") }}</p>
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
|
||||
{%- if config.extra.source_url and config.extra.footer.show_source %}
|
||||
<p>
|
||||
<a class="external" href="{{ config.extra.source_url }}" rel="{{ rel_attributes }}">
|
||||
{{- macros_translate::translate(key="source", default="Website source", language_strings=language_strings) -}}
|
||||
</a>
|
||||
</p>
|
||||
{%- endif %}
|
||||
|
||||
{%- if config.extra.footer.show_powered_by %}
|
||||
<p>
|
||||
<small>
|
||||
{%- set zola_link = '<a class="link external" href="https://www.getzola.org" rel="' ~ rel_attributes ~ '">Zola</a>' -%}
|
||||
{%- set duckquill_link = '<a class="link external" href="https://duckquill.daudix.one" rel="' ~ rel_attributes ~ '">Duckquill</a>' -%}
|
||||
{{ macros_translate::translate(key="powered_by", default="Powered by $ZOLA and $DUCKQUILL", language_strings=language_strings) | replace(from="$ZOLA", to=zola_link) | replace(from="$DUCKQUILL", to=duckquill_link) | safe }}
|
||||
</small>
|
||||
</p>
|
||||
{%- endif %}
|
||||
|
||||
{%- if config.extra.footer.socials %}
|
||||
<ul id="socials">
|
||||
{%- for link in config.extra.footer.socials %}
|
||||
<li>
|
||||
<a href="{{ link.url | safe }}" rel="{{ rel_attributes }} me" title="{{ link.name }}">
|
||||
<i class="icon" style='--icon: url("data:image/svg+xml,{{ link.icon }}")'></i>
|
||||
<span>{{ link.name }}</span>
|
||||
</a>
|
||||
</li>
|
||||
{%- endfor %}
|
||||
</ul>
|
||||
{%- endif %}
|
||||
</footer>
|
126
themes/duckquill/templates/partials/head.html
Normal file
126
themes/duckquill/templates/partials/head.html
Normal file
|
@ -0,0 +1,126 @@
|
|||
<head>
|
||||
<!-- {{ now() | date(format='%F %a %R') }} -->
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="description" content="{{ config.description }}" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="theme-color" content="{{ config.extra.accent_color | default(value='#9a9996') | safe }}" />
|
||||
{%- if config.extra.accent_color_dark %}
|
||||
<meta name="theme-color" content="{{ config.extra.accent_color_dark | safe }}" media="(prefers-color-scheme:dark)" />
|
||||
{%- endif %}
|
||||
{%- if config.extra.csp %}
|
||||
{%- include "partials/csp.html" %}
|
||||
{%- endif %}
|
||||
<title>{% include "partials/title.html" %}</title>
|
||||
<link rel="canonical" href="{{ current_url | default(value='/') | safe }}" />
|
||||
|
||||
{%- if config.extra.comments %}
|
||||
<link rel="me" href="https://{{ config.extra.comments.host }}/@{{ config.extra.comments.user }}" />
|
||||
<meta name="fediverse:creator" content="@{{ config.extra.comments.user }}@{{ config.extra.comments.host }}" />
|
||||
{%- endif %}
|
||||
|
||||
{%- include "partials/favicon.html" %}
|
||||
|
||||
{%- if config.generate_feeds and config.feed_filenames %}
|
||||
{% for feed in config.feed_filenames %}
|
||||
{% if feed == "atom.xml" %}
|
||||
<link rel="alternate" type="application/atom+xml" title="{{ config.title }} - Atom Feed" href="{{ get_url(path=feed) | safe }}">
|
||||
{% elif feed == "rss.xml" %}
|
||||
<link rel="alternate" type="application/rss+xml" title="{{ config.title }} - RSS Feed" href="{{ get_url(path=feed) | safe }}">
|
||||
{% else %}
|
||||
<link rel="alternate" href="{{ get_url(path=feed) | safe }}">
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{%- include "partials/variables.html" %}
|
||||
|
||||
{%- set styles = [ "style.css" ] %}
|
||||
|
||||
{%- if config.extra.bundled_fonts %}
|
||||
{%- set styles = styles | concat(with=["fonts.css"]) %}
|
||||
{%- endif %}
|
||||
|
||||
{%- if page.extra.katex or section.extra.katex or config.extra.katex %}
|
||||
{%- set styles = styles | concat(with=["katex.css"]) %}
|
||||
{%- endif %}
|
||||
|
||||
{%- if config.extra.styles %}
|
||||
{%- set styles = styles | concat(with=config.extra.styles) %}
|
||||
{%- endif %}
|
||||
|
||||
{%- if page.extra.styles %}
|
||||
{%- set styles = styles | concat(with=page.extra.styles) %}
|
||||
{%- elif section.extra.styles %}
|
||||
{%- set styles = styles | concat(with=section.extra.styles) %}
|
||||
{%- endif %}
|
||||
|
||||
{%- if not config.extra.debug.no_styles %}
|
||||
{%- for style in styles %}
|
||||
<link type="text/css" rel="stylesheet" href="{{ get_url(path=style) | safe }}" />
|
||||
{%- endfor %}
|
||||
|
||||
{%- if config.markdown.highlight_code and config.markdown.highlight_theme == "css" %}
|
||||
{%- if config.markdown.highlight_themes_css | length > 0 %}
|
||||
<link type="text/css" rel="stylesheet" href="{{ get_url(path='syntax-theme-light.css') }}" media="(prefers-color-scheme: light)" />
|
||||
<link type="text/css" rel="stylesheet" href="{{ get_url(path='syntax-theme-dark.css') }}" media="(prefers-color-scheme: dark)" />
|
||||
{%- else %}
|
||||
<link type="text/css" rel="stylesheet" href="{{ get_url(path='syntax-theme.css') }}" />
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
|
||||
{%- set scripts = ["closable.js"] %}
|
||||
|
||||
{%- if config.extra.show_copy_button %}
|
||||
{%- set scripts = scripts | concat(with=["copy-button.js"]) %}
|
||||
{%- endif %}
|
||||
|
||||
{%- if config.extra.goatcounter %}
|
||||
{%- set scripts = scripts | concat(with=["count.js"]) %}
|
||||
{%- endif %}
|
||||
|
||||
{%- if page.extra.katex or section.extra.katex or config.extra.katex %}
|
||||
{%- set scripts = scripts | concat(with=["katex.min.js", "auto-render.min.js", "katex-init.js"]) %}
|
||||
{%- endif %}
|
||||
|
||||
{%- if config.build_search_index %}
|
||||
{%- if config.search.index_format == "elasticlunr_json" -%}
|
||||
{%- set scripts = scripts | concat(with=["elasticlunr.min.js", "search-elasticlunr.js"]) %}
|
||||
{%- elif config.search.index_format == "fuse_json" -%}
|
||||
{%- set scripts = scripts | concat(with=["fuse.js", "search-fuse.js"]) %}
|
||||
{%- endif -%}
|
||||
{%- endif %}
|
||||
|
||||
{%- if config.extra.nav.show_theme_switcher %}
|
||||
{%- set scripts = scripts | concat(with=["theme-switcher.js"]) %}
|
||||
{%- endif %}
|
||||
|
||||
{%- if page.extra.comments.id %}
|
||||
{%- set scripts = scripts | concat(with=["comments.js"]) %}
|
||||
{%- endif %}
|
||||
|
||||
{%- if config.extra.scripts %}
|
||||
{%- set scripts = scripts | concat(with=config.extra.scripts) %}
|
||||
{%- endif %}
|
||||
|
||||
{%- if page.extra.scripts %}
|
||||
{%- set scripts = scripts | concat(with=page.extra.scripts) %}
|
||||
{%- elif section.extra.scripts %}
|
||||
{%- set scripts = scripts | concat(with=section.extra.scripts) %}
|
||||
{%- endif %}
|
||||
|
||||
{%- if scripts | length > 0 %}
|
||||
{%- for script in scripts %}
|
||||
<script type="text/javascript" defer {% if script == "count.js" %}data-goatcounter="https://{{ config.extra.goatcounter.user }}.{{ config.extra.goatcounter.host | default(value='goatcounter.com') }}/count"{% endif %} src="{{ get_url(path=script) | safe }}"></script>
|
||||
{%- endfor %}
|
||||
{%- endif %}
|
||||
|
||||
<meta property="og:site_name" content="{{ config.title }}" />
|
||||
<meta property="og:title" content="{% include 'partials/title.html' %}" />
|
||||
<meta property="og:url" content="{{ current_url | default(value='/') | safe }}" />
|
||||
<meta property="og:description" content="{% include 'partials/description.html' %}" />
|
||||
{%- if config.extra.card is not defined or config.extra.card != false -%}
|
||||
<meta property="og:image" content="{% include 'partials/card.html' %}" />
|
||||
{%- endif -%}
|
||||
<meta property="og:locale" content="{{ macros_translate::translate(key='date_locale', default='en_US', language_strings=language_strings) }}" />
|
||||
</head>
|
42
themes/duckquill/templates/partials/language_switcher.html
Normal file
42
themes/duckquill/templates/partials/language_switcher.html
Normal file
|
@ -0,0 +1,42 @@
|
|||
{#- Based on https://github.com/welpo/tabi/blob/7b00ed1d9dca5c529d2816c5b6679bfe600d63fc/templates/partials/language_switcher.html -#}
|
||||
|
||||
<li id="language-switcher">
|
||||
<details class="closable">
|
||||
<summary class="circle" title="{{ macros_translate::translate(key='language', default='Language', language_strings=language_strings) }}">
|
||||
<i class="icon"></i>
|
||||
</summary>
|
||||
<ul>
|
||||
{%- for lcode, ldetails in config.languages -%}
|
||||
{#- Skip the current language to avoid linking to the current page -#}
|
||||
{%- if lang == lcode -%}
|
||||
{%- continue -%}
|
||||
{%- endif -%}
|
||||
{#- Dynamically load the language strings for each language -#}
|
||||
{%- set other_language_strings = load_data(path="i18n/" ~ lcode ~ ".toml", required=false) -%}
|
||||
{%- if not other_language_strings -%}
|
||||
{%- set other_language_strings = load_data(path="themes/duckquill/i18n/" ~ lcode ~ ".toml", required=false) -%}
|
||||
{%- endif -%}
|
||||
{#- Use the loaded language strings to get the language name -#}
|
||||
{% set language_name = macros_translate::translate(key="language_name", default=lcode, language_strings=other_language_strings) %}
|
||||
{#- Check if the language code matches the default language -#}
|
||||
{%- if lcode == config.default_language -%}
|
||||
{#- If it does, link to the root path (no language code in URL) -#}
|
||||
<li>
|
||||
<a lang="{{ lcode }}" href="{{ current_url | replace(from='/' ~ lang ~ '/', to = '/') }}">{{ language_name }}</a>
|
||||
</li>
|
||||
{#- Check if the current language is the default language -#}
|
||||
{#- If it is, append the language code to the base URL -#}
|
||||
{%- elif lang == config.default_language -%}
|
||||
<li>
|
||||
<a lang="{{ lcode }}" href="{{ config.base_url }}/{{ lcode }}{{ current_path | default(value="/") | safe }}">{{ language_name }}</a>
|
||||
</li>
|
||||
{%- else -%}
|
||||
{#- If it's not, replace the current language code in the URL with the new one -#}
|
||||
<li>
|
||||
<a lang="{{ lcode }}" href="{{ current_url | replace(from='/' ~ lang ~ '/', to='/' ~ lcode ~ '/') }}">{{ language_name }}</a>
|
||||
</li>
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
</details>
|
||||
</li>
|
150
themes/duckquill/templates/partials/nav.html
Normal file
150
themes/duckquill/templates/partials/nav.html
Normal file
|
@ -0,0 +1,150 @@
|
|||
{%- set rel_attributes = macros_rel_attributes::rel_attributes() | trim -%}
|
||||
|
||||
{%- if config.extra.nav.auto_hide %}
|
||||
<div id="handle"></div>
|
||||
{%- endif %}
|
||||
<header id="site-nav">
|
||||
<nav>
|
||||
<a href="#main-content" tabindex="0">
|
||||
{{ macros_translate::translate(key="skip_to_content", default="Skip to Main Content", language_strings=language_strings) }}
|
||||
</a>
|
||||
<ul>
|
||||
<li id="home">
|
||||
<a href="{{ get_url(path='/', lang=lang) }}"
|
||||
{%- if current_url | default(value="/") | trim_end_matches(pat="/") | safe == get_url(path="/", lang=lang) | trim_end_matches(pat='/') | safe -%}
|
||||
class="active"
|
||||
{%- endif -%}>
|
||||
<i class="icon"></i>
|
||||
{{- config.title -}}
|
||||
</a>
|
||||
</li>
|
||||
<li class="divider"></li>
|
||||
{%- for link in config.extra.nav.links %}
|
||||
{%- if link.menu and link.menu | length > 0 -%}
|
||||
<li>
|
||||
<details class="closable">
|
||||
<summary>{{- macros_translate::translate(key=link.name, default=link.name, language_strings=language_strings) -}}</summary>
|
||||
<ul>
|
||||
{%- for link in link.menu -%}
|
||||
{%- if link.url is matching('https?://') %}
|
||||
<li>
|
||||
<a href="{{ link.url }}" rel="{{ rel_attributes }}" class="external">
|
||||
{{- macros_translate::translate(key=link.name, default=link.name, language_strings=language_strings) -}}
|
||||
</a>
|
||||
</li>
|
||||
{%- else %}
|
||||
<li>
|
||||
<a href="{{ get_url(path=link.url, lang=lang)}}"
|
||||
{%- if current_url | default(value='/') | trim_end_matches(pat='/') | safe == get_url(path=link.url, lang=lang) | trim_end_matches(pat='/') | safe -%}
|
||||
class="active"
|
||||
{%- endif -%}>
|
||||
{{- macros_translate::translate(key=link.name, default=link.name, language_strings=language_strings) -}}
|
||||
</a>
|
||||
</li>
|
||||
{%- endif %}
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
</details>
|
||||
</li>
|
||||
{%- elif link.url is matching('https?://') %}
|
||||
<li>
|
||||
<a href="{{ link.url }}" rel="{{ rel_attributes }}" class="external">
|
||||
{{- macros_translate::translate(key=link.name, default=link.name, language_strings=language_strings) -}}
|
||||
</a>
|
||||
</li>
|
||||
{%- else %}
|
||||
<li>
|
||||
<a href="{{ get_url(path=link.url, lang=lang)}}"
|
||||
{%- if current_url | default(value='/') | trim_end_matches(pat='/') | safe == get_url(path=link.url, lang=lang) | trim_end_matches(pat='/') | safe -%}
|
||||
class="active"
|
||||
{%- endif -%}>
|
||||
{{- macros_translate::translate(key=link.name, default=link.name, language_strings=language_strings) -}}
|
||||
</a>
|
||||
</li>
|
||||
{%- endif %}
|
||||
{%- endfor -%}
|
||||
{%- if config.build_search_index %}
|
||||
<li id="search">
|
||||
<button id="search-toggle" class="circle" title="{{ macros_translate::translate(key='search', default='Search', language_strings=language_strings) }}">
|
||||
<i class="icon"></i>
|
||||
</button>
|
||||
</li>
|
||||
{%- endif %}
|
||||
{%- if config.languages | length > 0 %}
|
||||
{%- include "partials/language_switcher.html" %}
|
||||
{%- endif -%}
|
||||
{%- if config.extra.default_theme or config.extra.nav.show_theme_switcher %}
|
||||
<li id="theme-switcher">
|
||||
<details class="closable">
|
||||
<summary class="circle" title="{{ macros_translate::translate(key='theme', default='Theme', language_strings=language_strings) }}">
|
||||
<i class="icon"></i>
|
||||
</summary>
|
||||
<ul>
|
||||
<li>
|
||||
<button class="circle" id="theme-light" title="{{ macros_translate::translate(key='theme_light', default='Switch to Light Theme', language_strings=language_strings) }}">
|
||||
<i class="icon"></i>
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button class="circle" id="theme-dark" title="{{ macros_translate::translate(key='theme_dark', default='Switch to Dark Theme', language_strings=language_strings) }}">
|
||||
<i class="icon"></i>
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button class="circle" id="theme-system" title="{{ macros_translate::translate(key='theme_system', default='Use System Theme', language_strings=language_strings) }}">
|
||||
<i class="icon"></i>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</details>
|
||||
</li>
|
||||
{%- endif %}
|
||||
{%- if config.feed_filenames | length > 1 and config.extra.nav.show_feed -%}
|
||||
<li id="feed">
|
||||
<details class="closable">
|
||||
<summary class="circle" title="{{ macros_translate::translate(key='feed', default='Feed', language_strings=language_strings) }}">
|
||||
<i class="icon"></i>
|
||||
</summary>
|
||||
<ul>
|
||||
{%- for feed in config.feed_filenames %}
|
||||
<li>
|
||||
<a href="{{ get_url(path=feed, lang=lang) }}" rel="{{ rel_attributes }}">
|
||||
{%- if feed == "atom.xml" -%}
|
||||
Atom
|
||||
{%- else -%}
|
||||
RSS
|
||||
{%- endif -%}
|
||||
</a>
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
</details>
|
||||
</li>
|
||||
{%- elif config.generate_feeds and config.extra.nav.show_feed %}
|
||||
<li id="feed">
|
||||
<a class="circle" href="{{ get_url(path=config.feed_filenames[0], lang=lang) }}" title="{{ macros_translate::translate(key='feed', default='Feed', language_strings=language_strings) }}">
|
||||
<i class="icon"></i>
|
||||
</a>
|
||||
</li>
|
||||
{%- endif %}
|
||||
{%- if config.extra.source_url and config.extra.nav.show_repo %}
|
||||
<li id="repo">
|
||||
<a class="circle" href="{{ config.extra.source_url }}" title="{{ macros_translate::translate(key='repo', default='Repository', language_strings=language_strings) }}">
|
||||
<i class="icon"></i>
|
||||
</a>
|
||||
</li>
|
||||
{%- endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
{%- if config.build_search_index %}
|
||||
<div id="search-container">
|
||||
<label for="search-bar" class="visually-hidden">
|
||||
{{- macros_translate::translate(key="search", default="Search", language_strings=language_strings) -}}
|
||||
</label>
|
||||
<input id="search-bar" placeholder="{{ macros_translate::translate(key='search_for', default='Search for', language_strings=language_strings) }}…" autocomplete="off" type="search" disabled>
|
||||
<div id="search-results-container">
|
||||
<div id="search-results"></div>
|
||||
</div>
|
||||
</div>
|
||||
{%- endif %}
|
||||
</header>
|
29
themes/duckquill/templates/partials/statements.html
Normal file
29
themes/duckquill/templates/partials/statements.html
Normal file
|
@ -0,0 +1,29 @@
|
|||
{%- if page.extra.archive and page.extra.archive != true -%}
|
||||
<div class="statement-container archive">
|
||||
<strong class="title">
|
||||
<i class="icon"></i>
|
||||
{{- macros_translate::translate(key="archived", default="Archived", language_strings=language_strings) -}}
|
||||
</strong>
|
||||
{{ page.extra.archive | markdown | safe }}
|
||||
</div>
|
||||
{%- endif -%}
|
||||
|
||||
{%- if page.extra.trigger -%}
|
||||
<div class="statement-container trigger">
|
||||
<strong class="title">
|
||||
<i class="icon"></i>
|
||||
{{- macros_translate::translate(key="trigger_warning", default="Trigger Warning", language_strings=language_strings) -}}
|
||||
</strong>
|
||||
{{ page.extra.trigger | markdown | safe }}
|
||||
</div>
|
||||
{%- endif -%}
|
||||
|
||||
{%- if page.extra.disclaimer -%}
|
||||
<div class="statement-container disclaimer">
|
||||
<strong class="title">
|
||||
<i class="icon"></i>
|
||||
{{-macros_translate::translate(key="disclaimer", default="Disclaimer", language_strings=language_strings) -}}
|
||||
</strong>
|
||||
{{ page.extra.disclaimer | markdown | safe }}
|
||||
</div>
|
||||
{%- endif -%}
|
39
themes/duckquill/templates/partials/title.html
Normal file
39
themes/duckquill/templates/partials/title.html
Normal file
|
@ -0,0 +1,39 @@
|
|||
{# Taken from https://github.com/welpo/tabi/blob/69713c973c11d7646c8fe56476261d96cc1978d8/templates/partials/title.html #}
|
||||
|
||||
{#- Setup -#}
|
||||
{%- if config.title -%}
|
||||
{%- set suffix = config.title | safe -%}
|
||||
{%- else -%}
|
||||
{{- throw(message='Title has not been set in config.toml, Please set one.') -}}
|
||||
{%- endif -%}
|
||||
{%- set custom_separator = config.extra.title_separator | default(value="-") -%}
|
||||
{%- set separator = " " ~ custom_separator ~ " " -%}
|
||||
|
||||
{#- Get the base path for the current language -#}
|
||||
{%- if lang != config.default_language %}
|
||||
{%- set base_path = "/" ~ lang ~ "/" %}
|
||||
{%- else -%}
|
||||
{%- set base_path = "/" %}
|
||||
{%- endif %}
|
||||
|
||||
{%- if current_path and current_path == base_path -%}
|
||||
{%- set prefix = "" -%}
|
||||
{%- set separator = "" -%}
|
||||
{% elif title %}
|
||||
{%- set prefix = title -%}
|
||||
{% elif section.title -%}
|
||||
{%- set prefix = section.title -%}
|
||||
{% elif page.title %}
|
||||
{%- set prefix = page.title -%}
|
||||
{% elif term.name %}
|
||||
{#- Individual tags -#}
|
||||
{%- set prefix = term.name -%}
|
||||
{% elif taxonomy.name %}
|
||||
{#- List of tags -#}
|
||||
{%- set prefix = macros_translate::translate(key=taxonomy.name, language_strings=language_strings) | capitalize -%}
|
||||
{% else %}
|
||||
{%- set prefix = "404" %}
|
||||
{%- endif -%}
|
||||
|
||||
{#- Return the final concatenated string -#}
|
||||
{{- prefix ~ separator ~ suffix -}}
|
33
themes/duckquill/templates/partials/toc.html
Normal file
33
themes/duckquill/templates/partials/toc.html
Normal file
|
@ -0,0 +1,33 @@
|
|||
{%- if page.extra.toc_ordered or section.extra.toc_ordered or config.extra.toc_ordered -%}
|
||||
{%- set list_element = "ol" -%}
|
||||
{%- else -%}
|
||||
{%- set list_element = "ul" -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- if page.toc -%}
|
||||
{%- set toc = page.toc -%}
|
||||
{%- elif section.toc -%}
|
||||
{%- set toc = section.toc -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- if page.extra.toc or section.extra.toc -%}
|
||||
{%- if toc | length > 0 -%}
|
||||
<h2>{{ macros_translate::translate(key="table_of_contents", default="Table of Contents", language_strings=language_strings) }}</h2>
|
||||
<{{ list_element }}>
|
||||
{%- for h1 in toc -%}
|
||||
<li>
|
||||
<a href="{{ h1.permalink | safe }}">{{ h1.title }}</a>
|
||||
{%- if h1.children -%}
|
||||
<{{ list_element }}>
|
||||
{%- for h2 in h1.children -%}
|
||||
<li>
|
||||
<a href="{{ h2.permalink | safe }}">{{ h2.title }}</a>
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
</{{ list_element }}>
|
||||
{%- endif -%}
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
</{{ list_element }}>
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
51
themes/duckquill/templates/partials/variables.html
Normal file
51
themes/duckquill/templates/partials/variables.html
Normal file
|
@ -0,0 +1,51 @@
|
|||
<style type="text/css">
|
||||
:root {
|
||||
{%- if page.extra.accent_color -%}
|
||||
--accent-color: {{ page.extra.accent_color | safe }};
|
||||
{%- elif section.extra.accent_color -%}
|
||||
--accent-color: {{ section.extra.accent_color | safe }};
|
||||
{%- else -%}
|
||||
--accent-color: {{ config.extra.accent_color | default(value="#6f8396") | safe }};
|
||||
{%- endif -%}
|
||||
}
|
||||
|
||||
{%- if page.extra.accent_color_dark -%}
|
||||
[data-theme="dark"] {
|
||||
--accent-color: {{ page.extra.accent_color_dark | safe }};
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root:not([data-theme="light"]) {
|
||||
--accent-color: {{ page.extra.accent_color_dark | safe }};
|
||||
}
|
||||
}
|
||||
{%- elif section.extra.accent_color_dark -%}
|
||||
[data-theme="dark"] {
|
||||
--accent-color: {{ section.extra.accent_color_dark | safe }};
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root:not([data-theme="light"]) {
|
||||
--accent-color: {{ section.extra.accent_color_dark | safe }};
|
||||
}
|
||||
}
|
||||
{%- elif config.extra.accent_color_dark -%}
|
||||
[data-theme="dark"] {
|
||||
--accent-color: {{ config.extra.accent_color_dark | safe }};
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root:not([data-theme="light"]) {
|
||||
--accent-color: {{ config.extra.accent_color_dark | safe }};
|
||||
}
|
||||
}
|
||||
{%- endif -%}
|
||||
|
||||
{%- if config.extra.debug.layout -%}
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
outline: solid 1px var(--accent-color);
|
||||
}
|
||||
{%- endif -%}
|
||||
</style>
|
10
themes/duckquill/templates/section.html
Normal file
10
themes/duckquill/templates/section.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{{ section.title }}</h1>
|
||||
{%- include "partials/statements.html" -%}
|
||||
{%- if section.extra.toc and not section.extra.toc_sidebar -%}
|
||||
{%- include "partials/toc.html" -%}
|
||||
{%- endif -%}
|
||||
{{ section.content | safe }}
|
||||
{% endblock content %}
|
31
themes/duckquill/templates/shortcodes/alert.html
Normal file
31
themes/duckquill/templates/shortcodes/alert.html
Normal file
|
@ -0,0 +1,31 @@
|
|||
{% import "macros/translate.html" as macros_translate %}
|
||||
|
||||
{%- set language_strings = load_data(path="i18n/" ~ lang ~ '.toml', required=false) -%}
|
||||
{%- if not language_strings -%}
|
||||
{%- set language_strings = load_data(path="themes/duckquill/i18n/" ~ lang ~ ".toml", required=false) -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- if note -%}
|
||||
{%- set alert_type = "note" -%}
|
||||
{%- set alert_string = macros_translate::translate(key="note", default="Note", language_strings=language_strings) -%}
|
||||
{%- elif tip -%}
|
||||
{%- set alert_type = "tip" -%}
|
||||
{%- set alert_string = macros_translate::translate(key="tip", default="Tip", language_strings=language_strings) -%}
|
||||
{%- elif important -%}
|
||||
{%- set alert_type = "important" -%}
|
||||
{%- set alert_string = macros_translate::translate(key="important", default="Important", language_strings=language_strings) -%}
|
||||
{%- elif warning -%}
|
||||
{%- set alert_type = "warning" -%}
|
||||
{%- set alert_string = macros_translate::translate(key="warning", default="Warning", language_strings=language_strings) -%}
|
||||
{%- elif caution -%}
|
||||
{%- set alert_type = "caution" -%}
|
||||
{%- set alert_string = macros_translate::translate(key="caution", default="Caution", language_strings=language_strings) -%}
|
||||
{%- endif -%}
|
||||
|
||||
<blockquote class="{{ alert_type }}">
|
||||
<p class="alert-title">
|
||||
<i class="icon"></i>
|
||||
{{- alert_string -}}
|
||||
</p>
|
||||
{{ body | markdown | safe }}
|
||||
</blockquote>
|
3
themes/duckquill/templates/shortcodes/crt.html
Normal file
3
themes/duckquill/templates/shortcodes/crt.html
Normal file
|
@ -0,0 +1,3 @@
|
|||
<div class="crt scanlines" aria-hidden="true">
|
||||
{{ body | markdown | safe }}
|
||||
</div>
|
38
themes/duckquill/templates/shortcodes/image.html
Normal file
38
themes/duckquill/templates/shortcodes/image.html
Normal file
|
@ -0,0 +1,38 @@
|
|||
{%- set image_classes = [] -%}
|
||||
{%- if full -%}
|
||||
{%- set image_classes = image_classes | concat(with="full") -%}
|
||||
{%- endif -%}
|
||||
{%- if full_bleed -%}
|
||||
{%- set image_classes = image_classes | concat(with="full-bleed") -%}
|
||||
{%- endif -%}
|
||||
{%- if start -%}
|
||||
{%- set image_classes = image_classes | concat(with="start") -%}
|
||||
{%- endif -%}
|
||||
{%- if end -%}
|
||||
{%- set image_classes = image_classes | concat(with="end") -%}
|
||||
{%- endif -%}
|
||||
{%- if pixels -%}
|
||||
{%- set image_classes = image_classes | concat(with="pixels") -%}
|
||||
{%- endif -%}
|
||||
{%- if transparent -%}
|
||||
{%- set image_classes = image_classes | concat(with="transparent") -%}
|
||||
{%- endif -%}
|
||||
{%- if no_hover -%}
|
||||
{%- set image_classes = image_classes | concat(with="no-hover") -%}
|
||||
{%- endif -%}
|
||||
{%- if spoiler -%}
|
||||
{%- set image_classes = image_classes | concat(with="spoiler") -%}
|
||||
{%- endif -%}
|
||||
{%- if spoiler and solid -%}
|
||||
{%- set image_classes = image_classes | concat(with="solid") -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- set image_classes = image_classes | join(sep=" ") -%}
|
||||
|
||||
{%- if url_min -%}
|
||||
<a href="{{ url }}">
|
||||
<img class="{{ image_classes }}" {%- if alt -%}alt="{{ alt }}"{%- endif -%} src="{{ url_min }}" {%- if config.markdown.lazy_async_image -%}decoding="async" loading="lazy"{%- endif -%} />
|
||||
</a>
|
||||
{%- else -%}
|
||||
<img class="{{ image_classes }}" {%- if alt -%}alt="{{ alt }}"{%- endif -%} src="{{ url }}" {%- if config.markdown.lazy_async_image -%}decoding="async" loading="lazy"{%- endif -%} />
|
||||
{%- endif -%}
|
16
themes/duckquill/templates/shortcodes/mastodon.html
Normal file
16
themes/duckquill/templates/shortcodes/mastodon.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
{%- if host -%}
|
||||
{%- set host = host -%}
|
||||
{%- else -%}
|
||||
{%- set host = config.extra.comments.host -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- if user -%}
|
||||
{%- set user = user -%}
|
||||
{%- else -%}
|
||||
{%- set user = config.extra.comments.user -%}
|
||||
{%- endif -%}
|
||||
|
||||
<iframe
|
||||
class="mastodon-embed"
|
||||
src="https://{{ host }}/@{{ user }}/{{ id }}/embed">
|
||||
</iframe>
|
50
themes/duckquill/templates/shortcodes/video.html
Normal file
50
themes/duckquill/templates/shortcodes/video.html
Normal file
|
@ -0,0 +1,50 @@
|
|||
{# Video classes #}
|
||||
{%- set video_classes = [] -%}
|
||||
{%- if full -%}
|
||||
{%- set video_classes = video_classes | concat(with="full") -%}
|
||||
{%- endif -%}
|
||||
{%- if full_bleed -%}
|
||||
{%- set video_classes = video_classes | concat(with="full-bleed") -%}
|
||||
{%- endif -%}
|
||||
{%- if start -%}
|
||||
{%- set video_classes = video_classes | concat(with="start") -%}
|
||||
{%- endif -%}
|
||||
{%- if end -%}
|
||||
{%- set video_classes = video_classes | concat(with="end") -%}
|
||||
{%- endif -%}
|
||||
{%- if pixels -%}
|
||||
{%- set video_classes = video_classes | concat(with="pixels") -%}
|
||||
{%- endif -%}
|
||||
{%- if transparent -%}
|
||||
{%- set video_classes = video_classes | concat(with="transparent") -%}
|
||||
{%- endif -%}
|
||||
{%- if spoiler -%}
|
||||
{%- set video_classes = video_classes | concat(with="spoiler") -%}
|
||||
{%- endif -%}
|
||||
{%- if spoiler and solid -%}
|
||||
{%- set video_classes = video_classes | concat(with="solid") -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- set video_classes = video_classes | join(sep=" ") -%}
|
||||
|
||||
{# Video attributes #}
|
||||
{%- set video_attributes = [] -%}
|
||||
{%- if autoplay -%}
|
||||
{%- set video_attributes = video_attributes | concat(with="autoplay") -%}
|
||||
{%- endif -%}
|
||||
{%- if controls -%}
|
||||
{%- set video_attributes = video_attributes | concat(with="controls") -%}
|
||||
{%- endif -%}
|
||||
{%- if loop -%}
|
||||
{%- set video_attributes = video_attributes | concat(with="loop") -%}
|
||||
{%- endif -%}
|
||||
{%- if muted -%}
|
||||
{%- set video_attributes = video_attributes | concat(with="muted") -%}
|
||||
{%- endif -%}
|
||||
{%- if playsinline -%}
|
||||
{%- set video_attributes = video_attributes | concat(with="playsinline") -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- set video_attributes = video_attributes | join(sep=" ") -%}
|
||||
|
||||
<video class="{{ video_classes }}" src="{{ url }}" {%- if alt -%}aria-title="{{ alt }}"{%- endif -%} {{ video_attributes }}></video>
|
6
themes/duckquill/templates/shortcodes/vimeo.html
Normal file
6
themes/duckquill/templates/shortcodes/vimeo.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
<iframe
|
||||
class="vimeo-embed"
|
||||
src="https://player.vimeo.com/video/{{ id }}{% if autoplay %}?autoplay=1{% endif %}"
|
||||
allow="autoplay; fullscreen; picture-in-picture"
|
||||
allowfullscreen>
|
||||
</iframe>
|
6
themes/duckquill/templates/shortcodes/youtube.html
Normal file
6
themes/duckquill/templates/shortcodes/youtube.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
<iframe
|
||||
class="youtube-embed"
|
||||
src="https://www.youtube-nocookie.com/embed/{{ id }}{% if autoplay %}?autoplay=1{% endif %}{% if autoplay and start %}&start={{ start }}{% elif start %}?start={{ start }}{% endif %}"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||
referrerpolicy="strict-origin-when-cross-origin" allowfullscreen>
|
||||
</iframe>
|
16
themes/duckquill/templates/taxonomy_list.html
Normal file
16
themes/duckquill/templates/taxonomy_list.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
{%- set number_of_tags = terms | length -%}
|
||||
<h1>{{ macros_translate::translate(key="tags_title", default="Tags", language_strings=language_strings) }}</h1>
|
||||
|
||||
<p>
|
||||
<small>{{ macros_translate::translate(key="tags", number=number_of_tags, default="$NUMBER tags", language_strings=language_strings) }}</small>
|
||||
</p>
|
||||
|
||||
<ul class="tags">
|
||||
{%- for tag in terms -%}
|
||||
<li><a href="{{ current_url }}{{ tag.slug }}"><span class="tag">{{ tag.name }}</span><span class="count">{{ tag.pages | length }}</span></a></li>
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
{% endblock content %}
|
25
themes/duckquill/templates/taxonomy_single.html
Normal file
25
themes/duckquill/templates/taxonomy_single.html
Normal file
|
@ -0,0 +1,25 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
{%- set date_format = macros_translate::translate(key="date_format", default="%B %d, %Y", language_strings=language_strings) -%}
|
||||
{%- set date_locale = macros_translate::translate(key="date_locale", default="en_US", language_strings=language_strings) -%}
|
||||
{%- set number_of_posts = term.pages | length -%}
|
||||
|
||||
{%- set term_name = "“" ~ term.name ~ "”" -%}
|
||||
<h1>
|
||||
{{- macros_translate::translate(key="posts_with_tag", default="Posts with tag $TAG", language_strings=language_strings) | replace(from="$TAG", to=term_name) -}}
|
||||
<a href="{{ current_url ~ 'atom.xml' }}"><i class="icon feed"></i></a>
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
<small>
|
||||
<a href="{{ get_url(path='tags', lang=lang) }}">
|
||||
{{ macros_translate::translate(key="all_tags", default="See all tags", language_strings=language_strings) }}
|
||||
</a>
|
||||
<br />
|
||||
{{ macros_translate::translate(key="posts", number=number_of_posts, default="$NUMBER posts", language_strings=language_strings) }}
|
||||
</small>
|
||||
</p>
|
||||
|
||||
{% include "partials/articles.html" %}
|
||||
{% endblock content %}
|
Loading…
Add table
Add a link
Reference in a new issue