init
This commit is contained in:
commit
d013ece0f3
363 changed files with 20823 additions and 0 deletions
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>
|
Loading…
Add table
Add a link
Reference in a new issue