homepage: add blog index

also minor bug fixes
This commit is contained in:
Fabian Montero 2025-08-26 13:20:04 -06:00
parent e71a06b6f0
commit 9b257e31fb
Signed by: fabian
GPG key ID: 1FFAC35E1798174F
5 changed files with 138 additions and 17 deletions

View file

@ -21,7 +21,7 @@ favicon_mimetype = "image/png"
menu_items = [
{name = "about", url = "$BASE_URL/about"},
{name = "lib", url = "$BASE_URL/lib"},
{name = "boardgame night highscores", url = "$BASE_URL/leaderboard"}
{name = "boardgame night highscores", url = "$BASE_URL/leaderboard"},
{name = "wiki↗", url = "https://wiki.posixlycorrect.com", newtab = true},
{name = "git↗", url = "https://git.posixlycorrect.com", newtab = true},
{name = "notes↗", url = "https://notes.posixlycorrect.com", newtab = true},

View file

@ -1,6 +0,0 @@
+++
title = "blog posts"
+++
## [2023-06-02: building a site with zola and sourcehut](@/blog/building_a_site_with_zola_and_sourcehut.md)
## [2023-09-19: introduction to gpg key usage](@/blog/introduction_to_gpg_key_usage.md)
## [2024-05-22: Stellaris virtual rush build](@/blog/stellaris_tall_virtual_build.md)

View file

@ -0,0 +1,5 @@
+++
title = "blog posts"
template = "blog_index.html"
paginate_by = 10
+++

View file

@ -0,0 +1,128 @@
{% import "macros/date.html" as date_macros -%}
{% import "macros/head.html" as head_macros -%}
{% import "macros/menu.html" as menu_macros -%}
{% import "macros/post.html" as post_macros -%}
{% import "macros/title.html" as title_macros -%}
<!DOCTYPE html>
<html lang="{%- if config.default_language -%}{{ config.default_language }}{%- else -%}en{%- endif -%}">
<head>
<title>{% block title -%}{{ section.title | default(value=config.title) }}{%- endblock title %}</title>
{{ head_macros::head(config=config) }}
{%- if config.generate_feed %}
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ get_url(path="rss.xml") | safe }}">
{% endif -%}
{%- if config.extra.favicon %}
<link rel="shortcut icon" type="{{ config.extra.favicon_mimetype | default(value="image/x-icon") | safe }}" href="{{ config.extra.favicon | safe }}">
{% endif -%}
{%- block extra_head %}
<style>
.post-list.minimal{list-style:none;margin:0;padding:0}
.post-list.minimal li{display:flex;gap:.5rem;align-items:baseline;white-space:nowrap;overflow:hidden;margin-bottom:.4rem}
.post-list.minimal .title{
font-size:1.1rem;
font-weight:600;
color:rgb(252,147,0);
overflow:hidden;
text-overflow:ellipsis
}
.post-list.minimal .title:hover{
text-decoration:underline;
}
.post-list.minimal .sep{opacity:.6}
.post-list.minimal time{opacity:.7;font-size:.9rem}
</style>
{% endblock extra_head -%}
</head>
<body class="">
<div class="container">
{% block header %}
<header class="header">
<div class="header__inner">
<div class="header__logo">
{%- if config.extra.logo_home_link %}{% set logo_link = config.extra.logo_home_link %}{% else %}{% set logo_link = config.base_url %}{% endif -%}
<a href="{{ logo_link | safe }}" style="text-decoration: none;">
<div class="logo">
{% block logo_content -%}
{%- if config.extra.logo_text %}{{ config.extra.logo_text }}{% else %}Terminimal theme{% endif -%}
{%- endblock logo_content %}
</div>
</a>
</div>
</div>
{% block header_menu %}
{{ menu_macros::menu(config=config, current_path=current_path) }}
{% endblock header_menu %}
</header>
{% endblock header %}
<div class="content">
{% block content %}
<div class="posts">
<header class="post-title">
<h1>{{ section.title | default(value="Blog") }}</h1>
{% if section.description %}<p>{{ section.description }}</p>{% endif %}
</header>
{% if paginator %}
{% set items = paginator.pages %}
{% else %}
{% set items = section.pages | sort(attribute="date") | reverse %}
{% endif %}
<ul class="post-list minimal">
{% for p in items %}
{% if not p.draft %}
<li>
<a class="title" href="{{ p.permalink }}" target="_blank" rel="noopener noreferrer">{{ p.title }}</a>
{% if p.date %}
<span class="sep">·</span>
<time datetime="{{ p.date | date(format="%Y-%m-%d") }}">{{ p.date | date(format="%b %e, %Y") }}</time>
{% endif %}
</li>
{% endif %}
{% endfor %}
</ul>
{% if paginator %}
<nav class="pagination">
{% if paginator.previous %}<a class="prev" href="{{ paginator.previous }}">Newer</a>{% endif %}
<span>Page {{ paginator.current_index }} of {{ paginator.number_pagers }}</span>
{% if paginator.next %}<a class="next" href="{{ paginator.next }}">Older</a>{% endif %}
</nav>
{% endif %}
</div>
{% endblock content %}
</div>
{% block footer %}
<footer class="footer">
<div class="footer__inner">
{%- if config.extra.copyright_html %}
<div class="copyright copyright--user">{{ config.extra.copyright_html | safe }}</div>
{% else %}
<div class="copyright">
{%- if config.extra.author %}
<span>© {{ date_macros::now_year() }} {{ config.extra.author }}</span>
{% else %}
<span>© {{ date_macros::now_year() }} Powered by <a href="https://www.getzola.org/">Zola</a></span>
{% endif -%}
<span class="copyright-theme"><span class="copyright-theme-sep"></span></span>
</div>
{% endif -%}
</div>
Powered by <a href="https://nixos.org/">NixOS</a> and <a href="https://vpsfree.org/">vpsfree.org</a>. Backed up by <a href="https://rsync.net/"> rsync.net</a>.
<br>
Theme adapted from <a href="https://github.com/pawroman/zola-theme-terminimal/">Terminimal</a> by pawroman.
</footer>
{% endblock footer %}
</div>
{%- block extra_body %}{% endblock extra_body -%}
</body>
</html>

View file

@ -59,14 +59,6 @@
<div class="posts">
Hi! :) You have reached the root endpoint of the posixlycorrect server,
my home server.
</br>
</br>
index:
{% set page = get_page(path="lib.md") %}
{{ post_macros::content(page=page, summary=false) }}
</div>
{% endblock content %}
</div>
@ -85,12 +77,14 @@
{% endif -%}
<span class="copyright-theme">
<span class="copyright-theme-sep">:: </span>
Theme adapted from <a href="https://github.com/pawroman/zola-theme-terminimal/">Terminimal</a> by pawroman
<span class="copyright-theme-sep"></span>
</span>
</div>
{% endif -%}
</div>
Powered by <a href="https://nixos.org/">NixOS</a> and <a href="https://vpsfree.org/">vpsfree.org</a>. Backed up by <a href="https://rsync.net/"> rsync.net</a>.
<br>
Theme adapted from <a href="https://github.com/pawroman/zola-theme-terminimal/">Terminimal</a> by pawroman.
</footer>
{% endblock footer %}