Update to Hugo v0.143.1

This commit is contained in:
Brandon Rozek 2025-02-16 11:04:21 -05:00
parent 3282b231c0
commit fd5c0865b5
No known key found for this signature in database
GPG key ID: DFB0E78F805F4567
18 changed files with 112 additions and 47 deletions

View file

@ -37,7 +37,7 @@ jobs:
- name: Setup Hugo
env:
HUGO_VERSION: 0.105.0
HUGO_VERSION: 0.143.1
run: |
curl -L "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz" --output hugo.tar.gz
tar -xvzf hugo.tar.gz

View file

@ -3,7 +3,9 @@ languageCode = "en-us"
title = "Brandon Rozek"
theme = "pulp"
enableGitInfo = true
ignoreErrors = ["error-remote-getjson"]
[security.http]
mediaTypes = ['^application/json']
[taxonomies]
series = "series"

View file

@ -204,7 +204,17 @@ We'll have to add the following contents to `theme/layouts/shortcodes/displayOnl
{{ $url := urls.Parse (.Get 0) }}
{{ $status_id := index (last 1 (split $url.Path "/")) 0 }}
{{ $api_url := printf "%s://%s/api/v1/statuses/%s" $url.Scheme $url.Host $status_id }}
{{ $dataJ := getJSON $api_url }}
{{ $dataJ := dict }}
{{ $url := $api_url }}
{{ with try (resources.GetRemote $url) }}
{{ with .Err }}
{{ errorf "Unable to get remote resource %s: %s" $url . }}
{{ else with .Value }}
{{ $dataJ = . | transform.Unmarshal }}
{{ else }}
{{ errorf "Unable to get remote resource %s" $url }}
{{ end }}
{{ end }}
{{ with $dataJ }}
{{ if ne .content "" }}

View file

@ -49,7 +49,7 @@ medium_enabled: false
"icon": "{{ .Site.BaseURL }}img/{{ .Site.Params.avatar }}",
"language": "en-US",
"authors": [
{{with $.Site.Author.name }}
{{with $.Site.Params.name }}
{ "name": "{{ . }}" }
{{ end }}
],
@ -71,7 +71,7 @@ My `list.json.json` follows the [JSON Feed](https://jsonfeed.org/) specification
"url": "{{ .Permalink }}",
"title": {{ .Title | jsonify }},
"authors": [
{{with $.Site.Author.name }}
{{with $.Site.Params.Author }}
{ "name": "{{ . }}" }
{{ end }}
],

View file

@ -7,7 +7,7 @@ authors: [
"Veena Ravishankar",
"Brandon Rozek"
]
date: 2020-06
date: 2020-06-01
publish_date: "2020/6"
conference: "International Workshop on Unification"
firstpage: 58

View file

@ -7,7 +7,7 @@ authors: [
"Selmer Bringsjord",
"Naveen Sundar Govindarajulu"
]
date: 2022-07
date: 2022-07-01
publish_date: "2022/07"
conference: "International Conference on Robot Ethics and Standards"
isbn: "978-1-7396142-0-1"

View file

@ -0,0 +1,27 @@
{{/* Get remote data. */}}
{{ $items := dict }}
{{ $url := "https://api.brandonrozek.com/postroll" }}
{{ with try (resources.GetRemote $url ) }}
{{ with .Err }}
{{ errorf "Unable to get remote resource %s: %s" $url . }}
{{ else with .Value }}
{{ $items = . | transform.Unmarshal }}
{{ else }}
{{ errorf "Unable to get remote resource %s" $url }}
{{ end }}
{{ end }}
{{ range $items.Ok }}
{{ $content := dict "mediaType" "text/markdown" "value" .comment }}
{{ $dates := dict "date" (time.AsTime .dateadded) }}
{{ $params := dict "url" .url "author" .author }}
{{ $page := dict
"content" $content
"dates" $dates
"kind" "page"
"params" $params
"path" .title
"title" .title
}}
{{ $.AddPage $page }}
{{ end }}

View file

@ -1,35 +0,0 @@
{{ 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 class="postroll-item" style="text-align: left;">
<p><a href="{{ .url }}"><strong style="font-size: 1.7rem;">{{ .title }}</strong></a> by <span class="postroll-author">{{ .author }}</span></p>
<p>{{ .comment }}</p>
<p>Added: <span class="postroll-date"> {{ .dateadded }} </span></p>
</div>
<hr/>
{{ end }}{{ end }}
<style>
.postroll-item {
margin-top: 2rem;
margin-bottom: 2rem;
text-align: left;
}
.postroll-author, .postroll-date {
color: #800000;
}
</style>
</article>
</main>
{{ end }}

View file

@ -81,7 +81,17 @@
<tr>
<td>Total Wikipedia Edits</td>
<td>
{{ $data := getJSON "https://en.wikipedia.org/w/api.php?action=query&list=users&ususers=BrandonRozek&usprop=editcount&format=json" }}
{{ $data := dict }}
{{ $url := "https://en.wikipedia.org/w/api.php?action=query&list=users&ususers=BrandonRozek&usprop=editcount&format=json" }}
{{ with try (resources.GetRemote $url) }}
{{ with .Err }}
{{ errorf "Unable to get remote resource %s: %s" $url . }}
{{ else with .Value }}
{{ $data = .Content | transform.Unmarshal }}
{{ else }}
{{ errorf "Unable to get remote resource %s" $url }}
{{ end }}
{{ end }}
{{ range first 1 $data.query.users }}
{{ .editcount }}
{{ end }}
@ -90,7 +100,17 @@
<tr>
<td>Total OpenStreetMap Edits</td>
<td>
{{ $data := getJSON "https://api.openstreetmap.org/api/0.6/user/16068861.json" }}
{{ $data := dict }}
{{ $url := "https://api.openstreetmap.org/api/0.6/user/16068861.json" }}
{{ with try (resources.GetRemote $url) }}
{{ with .Err }}
{{ errorf "Unable to get remote resource %s: %s" $url . }}
{{ else with .Value }}
{{ $data = .Content | transform.Unmarshal }}
{{ else }}
{{ errorf "Unable to get remote resource %s" $url }}
{{ end }}
{{ end }}
{{ $data.user.changesets.count }}
</td>
</tr>

View file

@ -56,7 +56,18 @@
<p><strong>Recorded Walk: </strong><a href="{{ .Permalink }}">{{ .Title }}</a></p>
{{ end }}
{{ $data := getJSON "https://en.wikipedia.org/w/api.php?action=query&format=json&list=usercontribs&ucuser=BrandonRozek&uclimit=1" }}
{{ $data := dict }}
{{ $url := "https://en.wikipedia.org/w/api.php?action=query&format=json&list=usercontribs&ucuser=BrandonRozek&uclimit=1" }}
{{ with try (resources.GetRemote $url) }}
{{ with .Err }}
{{ errorf "Unable to get remote resource %s: %s" $url . }}
{{ else with .Value }}
{{ $data = .Content | transform.Unmarshal }}
{{ else }}
{{ errorf "Unable to get remote resource %s" $url }}
{{ end }}
{{ end }}
{{ range first 1 $data.query.usercontribs }}
<p><strong>Last Wikipedia Edit: </strong><a href="https://en.wikipedia.org/?curid={{ .pageid }}">{{ .title }}</a></p>
{{ end }}

View file

@ -0,0 +1,30 @@
{{ define "main" }}
{{ partial "header.html" . }}
<main>
<article>
{{ .Content }}
{{ range .Pages }}
<div class="postroll-item" style="text-align: left;">
<p><a href="{{ .Params.url }}"><strong style="font-size: 1.7rem;">{{ .Title }}</strong></a> by <span class="postroll-author">{{ .Params.author }}</span></p>
<p>{{ .Content }}</p>
{{ $singlePageDateFormat := .Site.Params.singlePageDateFormat | default "January 2, 2006"}}
{{ $pubdate := .Date.Format $singlePageDateFormat }}
<p>Added: <span class="postroll-date"> {{ $pubdate }} </span></p>
</div>
<hr/>
{{ end }}
<style>
.postroll-item {
margin-top: 2rem;
margin-bottom: 2rem;
text-align: left;
}
.postroll-author, .postroll-date {
color: #800000;
}
</style>
</article>
</main>
{{ end }}

View file

@ -11,7 +11,7 @@ import argparse
import json
import sys
SAVE_DIR = "static/data/toots"
SAVE_DIR = "assets/data/toots"
# Grab arguments
parser = argparse.ArgumentParser(description="Save a toot")

@ -1 +1 @@
Subproject commit 615e03bca3167728bd91ad45de92e44b6fcede48
Subproject commit 525b28e98b9ce21a431a5cca63bbfe72df8bf868