mirror of
https://github.com/Brandon-Rozek/website.git
synced 2025-10-09 14:31:13 +00:00
Update to Hugo v0.143.1
This commit is contained in:
parent
3282b231c0
commit
fd5c0865b5
18 changed files with 112 additions and 47 deletions
|
@ -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 }}
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue