Postroll feature

This commit is contained in:
Brandon Rozek 2024-12-29 10:10:14 -05:00
parent b77b59a4d3
commit 4443eb3bb8
No known key found for this signature in database
GPG key ID: DFB0E78F805F4567
5 changed files with 31 additions and 1 deletions

View file

@ -3,6 +3,7 @@ languageCode = "en-us"
title = "Brandon Rozek" title = "Brandon Rozek"
theme = "pulp" theme = "pulp"
enableGitInfo = true enableGitInfo = true
ignoreErrors = ["error-remote-getjson"]
[taxonomies] [taxonomies]
series = "series" series = "series"

7
content/postroll.md Normal file
View file

@ -0,0 +1,7 @@
---
title: Postroll
description: Recently enjoyed blog posts
layout: postroll
---
Inspired by [Jedda's Postroll](https://notes.jeddacp.com/postroll/), here is a rolling list of 30 blog posts that I've recently read and enjoyed. This list refreshes daily.

View file

@ -0,0 +1,23 @@
{{ define "main" }}
{{ partial "header.html" . }}
<main>
<article>
{{ .Content }}
{{ $items := getJSON "https://api.brandonrozek.com/postroll"}}
{{ if not $items }}
{{ warnf "Failed to fetch postroll items from API." }}
{{ $items = dict }}
{{ end }}
{{ with $items.Ok }}{{ range . }}
<div style="text-align: left;">
<p><a href="{{ .url }}"><strong style="font-size: 1.6rem;">{{ .title }}</strong></a> by {{ .author }}</p>
<p>{{ .comment }}</p>
</div>
{{ end }}{{ end }}
</article>
</main>
{{ end }}

View file

@ -21,7 +21,6 @@
{{ $postCount := len $posts }} {{ $postCount := len $posts }}
<p> <p>
My most recent blog post was written on <strong>{{ $scratch.Get "latestDate" }}</strong> My most recent blog post was written on <strong>{{ $scratch.Get "latestDate" }}</strong>
with my first ever one written on <strong>{{ $scratch.Get "firstDate" }}</strong>. with my first ever one written on <strong>{{ $scratch.Get "firstDate" }}</strong>.