From 9b257e31fb2647cee529d2bbeea9159fa41ee16e Mon Sep 17 00:00:00 2001 From: Fabian Montero Date: Tue, 26 Aug 2025 13:20:04 -0600 Subject: [PATCH] homepage: add blog index also minor bug fixes --- homepage/posixlycorrect/config.toml | 2 +- homepage/posixlycorrect/content/blog.md | 6 - .../posixlycorrect/content/blog/_index.md | 5 + .../terminimal/templates/blog_index.html | 128 ++++++++++++++++++ .../themes/terminimal/templates/index.html | 14 +- 5 files changed, 138 insertions(+), 17 deletions(-) delete mode 100644 homepage/posixlycorrect/content/blog.md create mode 100644 homepage/posixlycorrect/content/blog/_index.md create mode 100644 homepage/posixlycorrect/themes/terminimal/templates/blog_index.html diff --git a/homepage/posixlycorrect/config.toml b/homepage/posixlycorrect/config.toml index 109b3df..0c210bc 100644 --- a/homepage/posixlycorrect/config.toml +++ b/homepage/posixlycorrect/config.toml @@ -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}, diff --git a/homepage/posixlycorrect/content/blog.md b/homepage/posixlycorrect/content/blog.md deleted file mode 100644 index 9b8d5bf..0000000 --- a/homepage/posixlycorrect/content/blog.md +++ /dev/null @@ -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) \ No newline at end of file diff --git a/homepage/posixlycorrect/content/blog/_index.md b/homepage/posixlycorrect/content/blog/_index.md new file mode 100644 index 0000000..1db40b0 --- /dev/null +++ b/homepage/posixlycorrect/content/blog/_index.md @@ -0,0 +1,5 @@ ++++ +title = "blog posts" +template = "blog_index.html" +paginate_by = 10 ++++ \ No newline at end of file diff --git a/homepage/posixlycorrect/themes/terminimal/templates/blog_index.html b/homepage/posixlycorrect/themes/terminimal/templates/blog_index.html new file mode 100644 index 0000000..272db3d --- /dev/null +++ b/homepage/posixlycorrect/themes/terminimal/templates/blog_index.html @@ -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 -%} + + + + + {% block title -%}{{ section.title | default(value=config.title) }}{%- endblock title %} + {{ head_macros::head(config=config) }} + + {%- if config.generate_feed %} + + {% endif -%} + + {%- if config.extra.favicon %} + + {% endif -%} + + {%- block extra_head %} + + {% endblock extra_head -%} + + + +
+ {% block header %} +
+
+ +
+ + {% block header_menu %} + {{ menu_macros::menu(config=config, current_path=current_path) }} + {% endblock header_menu %} +
+ {% endblock header %} + +
+ {% block content %} +
+
+

{{ section.title | default(value="Blog") }}

+ {% if section.description %}

{{ section.description }}

{% endif %} +
+ + {% if paginator %} + {% set items = paginator.pages %} + {% else %} + {% set items = section.pages | sort(attribute="date") | reverse %} + {% endif %} + +
    + {% for p in items %} + {% if not p.draft %} +
  • + {{ p.title }} + {% if p.date %} + · + + {% endif %} +
  • + {% endif %} + {% endfor %} +
+ + {% if paginator %} + + {% endif %} +
+ {% endblock content %} +
+ + {% block footer %} +
+ + Powered by NixOS and vpsfree.org. Backed up by rsync.net. +
+ Theme adapted from Terminimal by pawroman. +
+ {% endblock footer %} +
+ +{%- block extra_body %}{% endblock extra_body -%} + + diff --git a/homepage/posixlycorrect/themes/terminimal/templates/index.html b/homepage/posixlycorrect/themes/terminimal/templates/index.html index ee0aa6e..82c3958 100644 --- a/homepage/posixlycorrect/themes/terminimal/templates/index.html +++ b/homepage/posixlycorrect/themes/terminimal/templates/index.html @@ -59,14 +59,6 @@
Hi! :) You have reached the root endpoint of the posixlycorrect server, my home server. - -
-
- - index: - - {% set page = get_page(path="lib.md") %} - {{ post_macros::content(page=page, summary=false) }}
{% endblock content %} @@ -85,12 +77,14 @@ {% endif -%} - :: - Theme adapted from Terminimal by pawroman + {% endif -%} + Powered by NixOS and vpsfree.org. Backed up by rsync.net. +
+ Theme adapted from Terminimal by pawroman. {% endblock footer %}