diff --git a/layouts/_default/item.json.json b/layouts/_default/item.json.json index 7fe1224..d7b05a4 100644 --- a/layouts/_default/item.json.json +++ b/layouts/_default/item.json.json @@ -3,7 +3,7 @@ "url": "{{ .Permalink }}", "title": {{ .Title | jsonify }}, "authors": [ - {{with $.Site.Author.name }} + {{with $.Site.Params.Author }} { "name": "{{ . }}" } {{ end }} ], diff --git a/layouts/_default/list.as2.ajson b/layouts/_default/list.as2.ajson index eb0a55a..e0661f4 100644 --- a/layouts/_default/list.as2.ajson +++ b/layouts/_default/list.as2.ajson @@ -3,14 +3,14 @@ { "@context": "https://www.w3.org/ns/activitystreams", "actor": { - {{with $.Site.Author.name }}"name": "{{ . }}",{{ end }} + {{with $.Site.Params.Author }}"name": "{{ . }}",{{ end }} "url": "{{ .Site.BaseURL }}" }, "id": "{{ $page.Permalink }}", "object": { "attributedTo": [ { - {{with $.Site.Author.name }}"name": "{{ . }}",{{ end }} + {{with $.Site.Params.Author }}"name": "{{ . }}",{{ end }} "type": "Person", "url": "{{ .Site.BaseURL }}" } diff --git a/layouts/_default/list.atom.atom b/layouts/_default/list.atom.atom index 0b5d808..9c51ff2 100644 --- a/layouts/_default/list.atom.atom +++ b/layouts/_default/list.atom.atom @@ -18,7 +18,7 @@ Hugo {{ .Site.BaseURL }} - {{ with .Site.Author.name }}{{.}}{{end}} + {{ with .Site.Params.Author }}{{.}}{{end}} {{ now.Format "2006-01-02T15:04:05-07:00" | safeHTML }} {{ with .OutputFormats.Get "Atom" }} @@ -29,7 +29,7 @@ http://activitystrea.ms/schema/1.0/person {{ .Site.BaseURL }} - {{ with .Site.Author.name }}{{.}}{{end}} + {{ with .Site.Params.Author }}{{.}}{{end}} http://activitystrea.ms/schema/1.0/article {{ .Title }} diff --git a/layouts/_default/list.json.json b/layouts/_default/list.json.json index 6f59b8e..dcb9f35 100644 --- a/layouts/_default/list.json.json +++ b/layouts/_default/list.json.json @@ -7,7 +7,7 @@ "icon": "{{ .Site.BaseURL }}img/{{ .Site.Params.avatar }}", "language": "en-US", "authors": [ - {{with $.Site.Author.name }} + {{with $.Site.Params.Author }} { "name": "{{ . }}" } {{ end }} ], diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 76cbad5..51340a1 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -21,9 +21,9 @@ {{ .Description }} Hugo -- gohugo.io{{ with .Site.LanguageCode }} - {{.}}{{end}}{{ with .Site.Author.email }} - {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} - {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} + {{.}}{{end}}{{ with .Site.Params.email }} + {{.}}{{ with $.Site.Params.Author }} ({{.}}){{end}}{{end}}{{ with .Site.Params.email }} + {{.}}{{ with $.Site.Params.Author }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} {{.}}{{end}}{{ if not .Date.IsZero }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} {{ with .OutputFormats.Get "RSS" }} @@ -34,7 +34,7 @@ {{ .Title }} {{ .Permalink }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} - {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} + {{ with .Site.Params.email }}{{.}}{{ with $.Site.Params.Author }} ({{.}}){{end}}{{end}} {{ .Permalink }} {{ printf `` .Summary | safeHTML }} {{ printf `` .Content | safeHTML }} diff --git a/layouts/blog/list.html b/layouts/blog/list.html index 2897b9b..c6d24c2 100644 --- a/layouts/blog/list.html +++ b/layouts/blog/list.html @@ -10,7 +10,7 @@ {{ range last 1 $posts }} {{ $tags := .Site.Taxonomies.tags }}
- Hello! This page contains {{ $postCount | lang.NumFmt 0 }} posts + Hello! This page contains {{ $postCount | lang.FormatNumber 0 }} posts written in the past {{ div (sub now.Unix .Date.Unix) 31536000 }} years spanning {{ len $tags }} topics within the dropdown above. diff --git a/layouts/observations/list.html b/layouts/observations/list.html index 6c988f7..b2accaa 100644 --- a/layouts/observations/list.html +++ b/layouts/observations/list.html @@ -14,7 +14,7 @@ {{ end }} {{ $tags := .Site.Taxonomies.tags }}
- Hello! This page contains {{ $postCount | lang.NumFmt 0 }} observations, + Hello! This page contains {{ $postCount | lang.FormatNumber 0 }} observations, {{ len $tags }} of which are research grade.
{{ end }} diff --git a/layouts/partials/external/twitter_cards.html b/layouts/partials/external/twitter_cards.html deleted file mode 100644 index 4bc4770..0000000 --- a/layouts/partials/external/twitter_cards.html +++ /dev/null @@ -1,30 +0,0 @@ - -{{- with $.Params.images -}} - - -{{ else -}} -{{- $images := $.Resources.ByType "image" -}} -{{- $featured := $images.GetMatch "*feature*" -}} -{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} -{{- with $featured -}} - - -{{- else -}} -{{- with $.Site.Params.images -}} - - -{{ else -}} - -{{- end -}} -{{- end -}} -{{- end }} - - -{{ with .Site.Social.twitter -}} - -{{ end -}} -{{ range .Site.Authors }} -{{ with .twitter -}} - -{{ end -}} -{{ end -}} diff --git a/layouts/partials/head.amp.html b/layouts/partials/head.amp.html index 5927845..54c5c92 100644 --- a/layouts/partials/head.amp.html +++ b/layouts/partials/head.amp.html @@ -57,7 +57,6 @@ {{/* NOTE: These Hugo Internal Templates can be found starting at https://github.com/gohugoio/hugo/tree/master/tpl/tplimpl/embedded/templates */}} {{- template "_internal/opengraph.html" . -}} {{- template "_internal/schema.html" . -}} - {{- partial "external/twitter_cards.html" . -}} {{ partial "citation.html" . }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 6f0f83e..4449a55 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -62,7 +62,6 @@ {{/* NOTE: These Hugo Internal Templates can be found starting at https://github.com/gohugoio/hugo/tree/master/tpl/tplimpl/embedded/templates */}} {{- template "_internal/opengraph.html" . -}} {{- template "_internal/schema.html" . -}} - {{- partial "external/twitter_cards.html" . -}} {{ partial "citation.html" . }} diff --git a/layouts/shortcodes/displayOnlineToot.html b/layouts/shortcodes/displayOnlineToot.html index 345918b..bb4b8dd 100644 --- a/layouts/shortcodes/displayOnlineToot.html +++ b/layouts/shortcodes/displayOnlineToot.html @@ -1,7 +1,17 @@ {{ $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 }} {{ .Scratch.Set "toot" $dataJ }} {{ partial "external/toot.html" . }} diff --git a/layouts/shortcodes/displayToot.html b/layouts/shortcodes/displayToot.html index dac1b79..91ea84a 100644 --- a/layouts/shortcodes/displayToot.html +++ b/layouts/shortcodes/displayToot.html @@ -1,6 +1,15 @@ {{ $toot_reference := .Get 0 }} -{{ $url := printf "static/data/toots/%s.json" $toot_reference }} -{{ $dataJ := getJSON $url }} - +{{ $url := printf "data/toots/%s.json" $toot_reference }} +{{ $dataJ := dict }} +{{ with try (resources.Get $url) }} + {{ with .Err }} + {{ errorf "Unable to get resource %s: %s" $url . }} + {{ else with .Value }} + {{ $dataJ = . | transform.Unmarshal }} + {{ else }} + {{ errorf "Unable to get resource %s" $url }} + {{ end }} +{{ end }} +w {{ .Scratch.Set "toot" $dataJ }} {{ partial "external/toot.html" . }} diff --git a/layouts/tags/list.html b/layouts/tags/list.html index c6c6ed0..97fef7d 100644 --- a/layouts/tags/list.html +++ b/layouts/tags/list.html @@ -2,7 +2,7 @@ {{ partial "header.html" . }}
- Here you'll find {{ len .Pages | lang.NumFmt 0 }} posts + Here you'll find {{ len .Pages | lang.FormatNumber 0 }} posts about {{ .Title }} .