Migrate to Zola

This commit is contained in:
jultty 2024-08-18 13:23:10 -03:00
commit 86d0d27ef2
64 changed files with 1044 additions and 2477 deletions

6
templates/404.html Normal file
View file

@ -0,0 +1,6 @@
{% block content %}
<h1>404</h1>
<p>Page not found</p>
{% endblock content %}

80
templates/base.html Normal file
View file

@ -0,0 +1,80 @@
<!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 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/icon/icon_32.png", trailing_slash=false) }}">
<link rel="icon" type="image/png" sizes="16x16" href="{{ get_url(path="assets/img/icon/icon_16.png", trailing_slash=false) }}">
<link rel="icon" type="image/png" sizes="128x128" href="{{ get_url(path="assets/img/icon/icon_128.png", trailing_slash=false) }}">
{%- set description = page.content | default(value=config.description) | striptags | 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/logo/logo_192.png") }}" />
{% block rss %}<link rel="alternate" type="application/rss+xml" title="RSS ({{ lang }})" href="{{ get_url(path="rss.xml", lang=lang, trailing_slash=false) }}">
<link rel="alternate" type="application/rss+xml" title="Atom ({{ lang }})" href="{{ get_url(path="atom.xml", lang=lang, trailing_slash=false) }}">{% endblock %}
</head>
<body>
{% 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">
<nav>
<ul id="nav-menu">
<li><a id="home" href="{{ get_url(path="/") }}">Home</a></li>
<li><a href="{{ get_url(path="posts", lang=lang) }}">Posts</a></li>
<li><a href="{{ get_url(path="links", lang=lang) }}">Links</a></li>
<li><a href="{{ get_url(path="feeds", lang=lang) }}">RSS</a></li>
<li><a href="https://mastodon.bsd.cafe/@jutty">Mastodon</a></li>
</ul>
</nav>
<div id="language-selector">
{% set prepared_path = current_path | replace(from="pt/", to="") %}
{% if lang == "pt" %}
<a href="{{ get_url(path=prepared_path) }}">English</a>
{% else %}
<a href="{{ get_url(path="pt" ~ prepared_path) }}">Português</a>
{% endif %}
</div>
</div>
<main id="main">
{% block content %} {% endblock %}
</main>
</body>
</html>

42
templates/index.html Normal file
View file

@ -0,0 +1,42 @@
{% extends "base.html" %}
{% block header %}
<header>
<pre class="header-art"
role="img" aria-label="ASCII art with 'jutty.dev' in a 3D, slanted font">
__ __ __
__ /\ \__/\ \__ /\ \
/\_\ __ __\ \ ,_\ \ ,_\ __ __ \_\ \ __ __ __
\/\ \/\ \/\ \\ \ \/\ \ \/ /\ \/\ \ /'_` \ /'__`\/\ \/\ \
\ \ \ \ \_\ \\ \ \_\ \ \_\ \ \_\ \ __/\ \L\ \/\ __/\ \ \_/ |
_\ \ \ \____/ \ \__\\ \__\\/`____ \/\_\ \___,_\ \____\\ \___/
/\ \_\ \/___/ \/__/ \/__/ `/___/> \/_/\/__,_ /\/____/ \/__/
\ \____/ /\___/
\/___/ \/__/
</pre>
</header>
{% endblock header %}
{% block content %}
{% if lang == "pt" %}
{% set posts = get_section(path="posts/_index.pt.md") %}
{% else %}
{% set posts = get_section(path="posts/_index.md") %}
{% endif %}
<nav class="index-posts">
<ul id="posts">
{% for post in posts.pages %}
<li>
<span class="post-date">{{ post.date }}</span>
<a href="{{ post.permalink | safe }}">{{ post.title }}</a>
</li>
{% endfor %}
</ul>
</nav>
{% endblock content %}

14
templates/link-page.html Normal file
View file

@ -0,0 +1,14 @@
{% extends "base.html" %}
{% block content %}
<h1 id="post-title">
<a href="{{ page.extra.url }}">{{ page.title }}</a>
</h1>
<p class="post-date"><strong>Linked {{ page.date }}</strong></p>
{% if page.extra.comment %}
<p>{{ page.extra.comment }}</p>
{% endif %}
{{ page.content | safe }}
{% endblock content %}

25
templates/links.html Normal file
View file

@ -0,0 +1,25 @@
{% extends "base.html" %}
{% block content %}
{% set english_section = get_section(path="links/_index.md", lang="en") %}
<h1 class="title">
{{ section.title }}
</h1>
<ul id="posts">
{% for page in english_section.pages %}
<li>
<a class="post-date" href="{{ page.permalink }}">{{ page.date }}</a>
<a href="{{ page.extra.url | safe }}">{{ page.title }}</a>
{% if page.content %}
{% set portuguese_page = get_page(path="links/" ~ page.slug ~ ".pt.md") %}
{% if lang == "pt" %}
<span>{{ portuguese_page.content | replace(from="<p>", to="") | safe }}</span>
{% else %}
<span>{{ page.content | replace(from="<p>", to="") | safe }}</span>
{% endif %}
{% endif %}
</li>
{% endfor %}
</ul>
{% endblock content %}

5
templates/page.html Normal file
View file

@ -0,0 +1,5 @@
{% extends "base.html" %}
{% block content %}
{{ page.content | safe }}
{% endblock content %}

11
templates/post-page.html Normal file
View file

@ -0,0 +1,11 @@
{% extends "base.html" %}
{% block content %}
<h1 id="post-title">
{{ page.title }}
</h1>
<p class="post-date"><strong>{{ page.date }}</strong></p>
{{ page.content | safe }}
{% endblock content %}

15
templates/posts.html Normal file
View file

@ -0,0 +1,15 @@
{% extends "base.html" %}
{% block content %}
<h1 class="title">
{{ section.title }}
</h1>
<ul id="posts">
{% for page in section.pages %}
<li>
<span class="post-date">{{ page.date }}</span>
<a href="{{ page.permalink | safe }}">{{ page.title }}</a>
</li>
{% endfor %}
</ul>
{% endblock content %}