mirror of
https://github.com/Brandon-Rozek/website.git
synced 2025-08-03 23:31:59 +00:00
Postroll feature
This commit is contained in:
parent
b77b59a4d3
commit
4443eb3bb8
5 changed files with 31 additions and 1 deletions
|
@ -3,6 +3,7 @@ languageCode = "en-us"
|
|||
title = "Brandon Rozek"
|
||||
theme = "pulp"
|
||||
enableGitInfo = true
|
||||
ignoreErrors = ["error-remote-getjson"]
|
||||
|
||||
[taxonomies]
|
||||
series = "series"
|
||||
|
|
7
content/postroll.md
Normal file
7
content/postroll.md
Normal 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.
|
23
layouts/_default/postroll.html
Normal file
23
layouts/_default/postroll.html
Normal 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 }}
|
|
@ -21,7 +21,6 @@
|
|||
|
||||
{{ $postCount := len $posts }}
|
||||
|
||||
|
||||
<p>
|
||||
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>.
|
||||
|
|
Loading…
Add table
Reference in a new issue