blog/templates/base.html
2026-05-02 16:58:00 -03:00

143 lines
7.4 KiB
HTML

{%- if page %}
{%- set translation_count = page.translations | length %}
{%- elif section %}
{%- set translation_count = section.translations | length %}
{%- else %}
{%- set translation_count = 0 %}
{%- endif -%}
<!DOCTYPE html>
{%- if lang == "pt" %}
<html lang="pt-BR" id="theme">
{%- else %}
<html lang="{{ lang }}" id="theme">
{%- endif %}
<head prefix="og: https://ogp.me/ns/website#">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
<meta name="viewport" content="width=device-width, initial-scale=1">
{%- set title_tail = " ~ " ~ config.title %}
{%- if page.title %}
{%- set title = page.title ~ title_tail %}
{%- elif section.title %}
{%- set title = section.title ~ title_tail %}
{%- else %}
{%- set title = config.title %}
{%- endif %}
<title>{{ title }}</title>
<link href="{{ get_url(path="assets/css/style.css", trailing_slash=false) }}" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="{{ get_url(path="assets/css/syntax-dark.css", trailing_slash=false) }}" media="(prefers-color-scheme: dark)" />
<link rel="stylesheet" type="text/css" href="{{ get_url(path="assets/css/syntax-light.css", trailing_slash=false) }}" media="(prefers-color-scheme: light)" />
<link rel="icon" type="image/png" sizes="36x36" href="{{ get_url(path="assets/img/icons/kitty/kitty_32.png", trailing_slash=false) }}">
<link rel="icon" type="image/png" sizes="16x16" href="{{ get_url(path="assets/img/icons/kitty/kitty_16.png", trailing_slash=false) }}">
<link rel="icon" type="image/png" sizes="128x128" href="{{ get_url(path="assets/img/icons/kitty/kitty_circle_128.png", trailing_slash=false) }}">
<link rel="me" href="https://tilde.zone/@jutty">
<link rel="webmention" href="https://webmention.io/jutty.dev/webmention"/>
{%- set description = page.content | default(value=config.description) | striptags | regex_replace(pattern="\n", rep=" ") | truncate(length=120) %}
<meta property="og:title" content="{{ title }}" />
<meta property="og:description" content="{{ description }}" />
<meta property="og:type" content="website" />
<meta property="og:url" content="{{ current_url | default(value= get_url(path="/")) | safe }}" />
<meta property="og:image" content="{{ get_url(path="assets/img/icons/kitty/kitty_circle_192.png") }}" />
<meta name="fediverse:creator" content="@jutty@tilde.zone">
<meta name="octo-policy" content="index">
{%- block octo_head -%}{%- endblock %}
{% if page.taxonomies -%}
{%- for taxonomy, terms in page.taxonomies -%}
{%- if taxonomy == "tags" -%}
{%- for tag in terms -%}
<link rel="octo:octothorpes" href="{{ tag }}">
{% endfor -%}
{%- endif -%}
{% endfor -%}
{%- endif %}
{%- block rss -%}
{%- if lang == "pt" %}
{%- set locale_all_content = "Todo o conteúdo" %}
{%- set locale_language_name = "Português" %}
{% else %}
{%- set locale_all_content = "All content" %}
{%- set locale_language_name = "English" %}
{%- endif %}
<link rel="alternate" type="application/rss+xml" title="{{ locale_all_content }} ({{ locale_language_name }})" href="{{ get_url(path="atom.xml", lang=lang, trailing_slash=false) }}">
<link rel="alternate" type="application/rss+xml" title="Posts ({{ locale_language_name }})" href="{{ get_url(path="posts/atom.xml", lang=lang, trailing_slash=false) }}">
<link rel="alternate" type="application/rss+xml" title="{% if lang == "pt" %}Notas{% else %}Notes{% endif %} ({{ locale_language_name }})" href="{{ get_url(path="notes/atom.xml", lang=lang, trailing_slash=false) }}">
<link rel="alternate" type="application/rss+xml" title="Links" href="{{ get_url(path="links/atom.xml", trailing_slash=false) }}">
{%- endblock %}
<script defer src="https://stats.jutty.dev/script.js" data-website-id="f402fd3a-d5db-4121-ac20-3ca2eaea338a"></script>
<noscript><img src="https://stats.jutty.dev/p/rYMIdIgEV"></noscript>
</head>
<body>
<div id="container">
<div>
{%- if lang == "pt" %}
<a id="skip-to-main" href="#main">Saltar para o conteúdo</a>
{%- else %}
<a id="skip-to-main" href="#main">Skip to content</a>
{% endif -%}
{% block header %}{% endblock %}
<div id="user-controls" class="{% if current_path and (current_path == "/" or current_path == "pt/" ) %}index-user-controls{% else %}subpage-user-controls{% endif %}">
<nav id="nav-menu">
<ul>
{%- if lang == "pt" %}
<li><a id="home" href="{{ get_url(path="/pt") }}">Início</a></li>
{%- else %}
<li><a id="home" href="{{ get_url(path="/") }}">Home</a></li>
{%- endif %}
<li><a href="{{ get_url(path="posts", lang=lang) }}">Posts</a></li>
<li><a href="{{ get_url(path="notes", lang=lang) }}">{% if lang == "pt" %}Notas{% else %}Notes{% endif %}</a></li>
<li><a href="{{ get_url(path="links", lang=lang) }}">Links</a></li>
<li><a class="nav-tags-link" href="{{ get_url(path="tags", lang=lang) }}">Tags</a></li>
<li><a class="rss-link" href="{{ get_url(path="feeds", lang=lang) }}">RSS</a></li>
<li><a href="http://jutty.dev/#talk">Socials</a></li>
</ul>
</nav>
{% if current_path and translation_count > 1 %}
{%- set slashless_current_path = current_path | regex_replace(pattern="^\/", rep="") %}
{%- set english_path = current_path | regex_replace(pattern="pt\/", rep="") %}
<div id="language-selector">
<figure id="language-icon">
<img src="{{ get_url(path="assets/img/icons/language.svg") }}"
alt="{% if lang == "pt" %}Ícone de idioma{% else %}Language icon{% endif %}"/>
</figure>
{%- if lang == "pt" %}<a href="{{ get_url(path=english_path) }}">EN</a>{% else %}<a href="{{ get_url(path=slashless_current_path, lang="pt") }}">PT</a>
{%- endif %}
</div>
{%- endif %}
</div>
</div>
<main id="main">
{%- block content %}{% endblock %}
</main>
<footer>
{%- block footer %}
<hr/>
<p class="footer-text">
{%- if lang == "pt" %}feito por{% else %}made by{% endif %} <a href="https://jutty.dev">jutty</a>
{% if lang == "pt" %}com{% else %}with{% endif %} <a href="https://www.getzola.org/">Zola</a>
&bullet; <a href="https://codeberg.org/jutty/blog">{% if lang == "pt" %}código fonte{% else %}source code{% endif %}</a>
&bullet; <a href="https://jutty.dev/privacy">{% if lang == "pt" %}privacidade{% else %}privacy{% endif %}</a>
&bullet; <a href="{{ get_url(path="acknowledgments") }}">{% if lang == "pt" %}créditos{% else %}acknowledgments{% endif %}</a>
<br/>
{% if lang == "pt" %}gerado em{% else %}built{% endif %} <time>{{ now(utc=true) | date(format="%Y-%m-%d %H:%M") }} UTC</time>,
{{ now(timestamp=true) }}{% if lang == "pt" %}&#xba; segundo não-bissexto da Era Unix{% else %} non-leap seconds since the Unix Epoch{% endif %}
</p>
{% endblock footer -%}
</footer>
</div>
</body>
</html>