init
This commit is contained in:
commit
d013ece0f3
363 changed files with 20823 additions and 0 deletions
74
templates/partials/articles.html
Normal file
74
templates/partials/articles.html
Normal file
|
@ -0,0 +1,74 @@
|
|||
{%- 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 -%}
|
||||
{%- if page.colocated_path -%}
|
||||
{%- set blurnail = resize_image(path=page.colocated_path ~ page.extra.banner, width=4, height=2, op="fill", format="webp") -%}
|
||||
{%- else -%}
|
||||
{%- set blurnail_url = page.extra.banner -%} <!-- Ensure no leading slash -->
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
|
||||
|
||||
<article {% if article_type %}class="{{ article_type }}"{% endif %} {% if blurnail or blurnail_url %}style="--blurnail: url('{{ blurnail.url | default(value=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>
|
17
templates/partials/card.html
Normal file
17
templates/partials/card.html
Normal file
|
@ -0,0 +1,17 @@
|
|||
{%- 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 -%}
|
||||
{%- if page.colocated_path -%}
|
||||
{%- set card = resize_image(path=page.colocated_path ~ page.extra.banner, width=1200, height=628, op="fill") -%}
|
||||
{{ card.url }}
|
||||
{%- else -%}
|
||||
{{ page.extra.banner }}
|
||||
{%- endif -%}
|
||||
|
||||
{%- else -%}
|
||||
{{ get_url(path="card.png") }}
|
||||
{%- endif -%}
|
70
templates/partials/footer.html
Normal file
70
templates/partials/footer.html
Normal file
|
@ -0,0 +1,70 @@
|
|||
{%- set rel_attributes = macros_rel_attributes::rel_attributes() | trim -%}
|
||||
|
||||
<footer id="site-footer">
|
||||
<div id="wcb" class="carbonbadge"></div>
|
||||
<script src="https://unpkg.com/website-carbon-badges@1.1.3/b.min.js" defer></script>
|
||||
<p></p>
|
||||
{%- 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>
|
134
templates/partials/head.html
Normal file
134
templates/partials/head.html
Normal file
|
@ -0,0 +1,134 @@
|
|||
<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" %}
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" integrity="sha512-..." crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
|
||||
|
||||
{%- 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 %}
|
||||
|
||||
<script type="module">
|
||||
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';
|
||||
mermaid.initialize({ startOnLoad: true });
|
||||
</script>
|
||||
|
||||
|
||||
<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>
|
Loading…
Add table
Add a link
Reference in a new issue