updates for new version of hugo

This commit is contained in:
Don Harper 2024-11-12 08:08:49 -06:00
parent 7069191b84
commit dbe39c9cce
3 changed files with 161 additions and 150 deletions

View file

@ -6,10 +6,11 @@ theme = "minimage"
disqusShortname = "" disqusShortname = ""
# Enable Google Analytics by entering your tracking code # Enable Google Analytics by entering your tracking code
googleAnalytics = "" googleAnalytics = ""
paginate = 5
Copyright = "All rights reserved - 2006-" Copyright = "All rights reserved - 2006-"
preserveTaxonomyNames = true preserveTaxonomyNames = true
#canonifyurls = true #canonifyurls = true
[paginationp]
pagerSize = 5
[taxonomies] [taxonomies]
category = "categories" category = "categories"

View file

@ -16,7 +16,7 @@ Focus_Keyword: "close"
# Technology # Technology
Since all the changes on [Twitter](https://twitter.com/duckunix), I am now active on [Fosstodon](https://fosstodom/@duckunix), which is a [Mastodon](https://joinmastodon.org/). I joined back in 2018, but I just started using it more. My #introduction toot: Since all the changes on [Twitter](https://twitter.com/duckunix), I am now active on [Fosstodon](https://fosstodom/@duckunix), which is a [Mastodon](https://joinmastodon.org/). I joined back in 2018, but I just started using it more. My #introduction toot:
{{<smoot "fosstodon.org" "100578860152016241">}} {{<smoot instance="fosstodon.org" id="100578860152016241">}}
On the home network front, I finally retired the big server as the drivers were failing. I decided to move the containers running there to my old desktop which was not doing anything. Some new disks, and life is better there. On the home network front, I finally retired the big server as the drivers were failing. I decided to move the containers running there to my old desktop which was not doing anything. Some new disks, and life is better there.

View file

@ -1,157 +1,167 @@
{{ $masIns := .Get 0 }} {{ $masIns := .Get "instance" }}
{{ $id := .Get "id" }}
{{ $tootLink := "" }} {{ $tootLink := "" }}
{{ $card := "" }} {{ $card := "" }}
{{ $handleInst := "" }} {{ $handleInst := "" }}
{{ $mediaMD5 := "" }} {{ $mediaMD5 := "" }}
{{ $imageCount := 0 }} {{ $imageCount := 0 }}
{{ $votesCount := 0 }} {{ $votesCount := 0 }}
{{ $id := .Get 1 }}
{{ $urlToGet := print "https://" $masIns "/api/v1/statuses/" $id }} {{ $urlToGet := print "https://" $masIns "/api/v1/statuses/" $id }}
{{ $json := getJSON $urlToGet }}
{{ $jsonHolder := $json }}{{/* Being safe */}}
{{ if isset $json "account" }} {{- with resources.GetRemote $urlToGet -}}
{{ $tootLink = print "https://" $masIns "@" $json.account.acct "/status/" $id }} {{ if (resources.GetRemote $urlToGet).Err }}
{{ $handleInst = print "@" $json.account.acct "@" $masIns }} <blockquote class="toot-blockquote">
{{ end }} <p class="ctr legal">[Source not online<br />
at time of site build.]</p>
</blockquote>
{{ else }}
{{ $json := unmarshal .Content }}
{{ $jsonHolder := $json }}{{/* Being safe */}}
{{ if isset $json "content" }} {{ if isset $json "account" }}
<blockquote class="tweet-card" cite="{{ $tootLink }}"> {{ $tootLink = print "https://" $masIns "@" $json.account.acct "/status/" $id }}
<div class="tweet-header"> {{ $handleInst = print "@" $json.account.acct "@" $masIns }}
<a class="tweet-profile twitterExt" href="https://{{ $masIns }}/@{{ $json.account.acct }}" rel="noopener"> {{ end }}
<img
src="{{ $json.account.avatar }}" {{ if isset $json "content" }}
alt="Mastodon avatar for {{ $handleInst }}" <blockquote class="toot-blockquote" cite="{{ $tootLink }}">
loading="lazy" <div class="toot-header">
/> <a class="toot-profile" href="https://{{ $masIns }}/@{{ $json.account.acct }}" rel="noopener">
</a> <img
<div class="tweet-author"> src="{{ $json.account.avatar }}"
<a class="tweet-author-name twitterExt" href="https://{{ $masIns }}/@{{ $json.account.acct }}" rel="noopener">{{ $json.account.display_name }}</a> alt="Mastodon avatar for {{ $handleInst }}"
<a class="tweet-author-handle twitterExt" href="https://{{ $masIns }}/@{{ $json.account.acct }}" rel="noopener">{{ $handleInst }}</a> loading="lazy"
</div> />
</div> </a>
<p class="tweet-body"> <div class="toot-author">
{{ $json.content | safeHTML }} <a class="toot-author-name" href="https://{{ $masIns }}/@{{ $json.account.acct }}" rel="noopener">{{ $json.account.display_name }}</a>
</p> <a class="toot-author-handle" href="https://{{ $masIns }}/@{{ $json.account.acct }}" rel="noopener">{{ $handleInst }}</a>
{{ with $json.media_attachments }} </div>
{{ range $media_attachments := . }} </div>
{{ if eq $media_attachments.type "image" }} {{ $json.content | safeHTML }}
{{ $imageCount = (add ($imageCount) 1) }} {{ with $json.media_attachments }}
{{ end }} {{ range $media_attachments := . }}
{{ end }} {{ if eq $media_attachments.type "image" }}
<div class="tweet-img-grid-{{ $imageCount }}"> {{ $imageCount = (add ($imageCount) 1) }}
{{ range $media_attachments := . }} {{ end }}
{{ if eq $media_attachments.type "image" }} {{ end }}
{{ $mediaMD5 = md5 $media_attachments.url }} <div class="toot-img-grid-{{ $imageCount }}">
<style> {{ range $media_attachments := . }}
.img-{{ $mediaMD5 }} { {{ if eq $media_attachments.type "image" }}
aspect-ratio: {{ $media_attachments.meta.original.width }} / {{ $media_attachments.meta.original.height }}; {{ $mediaMD5 = md5 $media_attachments.url }}
} <style>
</style> .img-{{ $mediaMD5 }} {
<img aspect-ratio: {{ $media_attachments.meta.original.width }} / {{ $media_attachments.meta.original.height }};
src="{{ $media_attachments.url }}" }
alt="Image {{ $media_attachments.id }} from toot {{ $id }} on {{ $masIns }}" </style>
class="tweet-media-img img-{{ $mediaMD5 }}{{ if $json.sensitive }} tweet-sens-blur{{ end }}" <img
loading="lazy" src="{{ $media_attachments.url }}"
{{- if $json.sensitive }}onclick="this.classList.toggle('tweet-sens-blur-no')"{{- end }} alt="Image {{ $media_attachments.id }} from toot {{ $id }} on {{ $masIns }}"
/> class="toot-media-img img-{{ $mediaMD5 }}{{ if $json.sensitive }} toot-sens-blur{{ end }}"
{{- if $json.sensitive -}} loading="lazy"
<div class="blur-text"> {{- if $json.sensitive }}onclick="this.classList.toggle('toot-sens-blur-no')"{{- end }}
Sensitive content<br /> />
(flagged&nbsp;at&nbsp;origin) {{- if $json.sensitive -}}
</div> <div class="blur-text">
{{- end -}} Sensitive content<br />
{{ end }} (flagged&nbsp;at&nbsp;origin)
{{ end }} </div>
</div> {{- end -}}
{{/* {{ end }}
N.B.: {{ end }}
The above results in an empty, no-height div </div>
when there's no image but there **is** {{/*
at least one item in `$media_attachments`. N.B.:
Unfortunately, it seems to be the only way The above results in an empty, no-height div
to accomplish this. Not a good HTML practice, when there's no image but there **is**
but gets the job done. at least one item in `$media_attachments`.
*/}} Unfortunately, it seems to be the only way
{{ range $media_attachments := . }} to accomplish this. Not a good HTML practice,
{{ if eq $media_attachments.type "video" }} but gets the job done.
{{ $mediaMD5 = md5 $media_attachments.url }} */}}
<style> {{ range $media_attachments := . }}
.img-{{ $mediaMD5 }} { {{ if eq $media_attachments.type "video" }}
aspect-ratio: {{ $media_attachments.meta.original.width }} / {{ $media_attachments.meta.original.height }}; {{ $mediaMD5 = md5 $media_attachments.url }}
} <style>
</style> .img-{{ $mediaMD5 }} {
<div class="ctr tweet-video-wrapper"> aspect-ratio: {{ $media_attachments.meta.original.width }} / {{ $media_attachments.meta.original.height }};
<video muted playsinline controls class="ctr tweet-media-img img-{{ $mediaMD5 }}{{ if $json.sensitive }} tweet-sens-blur{{ end }}"{{- if $json.sensitive }}onclick="this.classList.toggle('tweet-sens-blur-no')"{{- end }}> }
<source src="{{ $media_attachments.url }}"> </style>
<p class="legal ctr">(Your browser doesn&rsquo;t support the <code>video</code> tag.)</p> <div class="ctr toot-video-wrapper">
</video> <video muted playsinline controls class="ctr toot-media-img img-{{ $mediaMD5 }}{{ if $json.sensitive }} toot-sens-blur{{ end }}"{{- if $json.sensitive }}onclick="this.classList.toggle('toot-sens-blur-no')"{{- end }}>
{{- if $json.sensitive -}} <source src="{{ $media_attachments.url }}">
<div class="blur-text"> <p class="legal ctr">(Your browser doesn&rsquo;t support the <code>video</code> tag.)</p>
Sensitive content<br /> </video>
(flagged&nbsp;at&nbsp;origin) {{- if $json.sensitive -}}
</div> <div class="blur-text">
{{- end -}} Sensitive content<br />
</div> (flagged&nbsp;at&nbsp;origin)
{{ end }} </div>
{{ if eq $media_attachments.type "gifv" }} {{- end -}}
{{ $mediaMD5 = md5 $media_attachments.url }} </div>
<style> {{ end }}
.img-{{ $mediaMD5 }} { {{ if eq $media_attachments.type "gifv" }}
aspect-ratio: {{ $media_attachments.meta.original.width }} / {{ $media_attachments.meta.original.height }}; {{ $mediaMD5 = md5 $media_attachments.url }}
} <style>
</style> .img-{{ $mediaMD5 }} {
<div class="ctr tweet-video-wrapper"> aspect-ratio: {{ $media_attachments.meta.original.width }} / {{ $media_attachments.meta.original.height }};
<video loop autoplay muted playsinline controls controlslist="nofullscreen" class="ctr tweet-media-img img-{{ $mediaMD5 }}{{ if $json.sensitive }} tweet-sens-blur{{ end }}" {{- if $json.sensitive }}onclick="this.classList.toggle('tweet-sens-blur-no')"{{- end }}> }
<source src="{{ $media_attachments.url }}"> </style>
<p class="legal ctr">(Your browser doesn&rsquo;t support the <code>video</code> tag.)</p> <div class="ctr toot-video-wrapper">
</video> <video loop autoplay muted playsinline controls controlslist="nofullscreen" class="ctr toot-media-img img-{{ $mediaMD5 }}{{ if $json.sensitive }} toot-sens-blur{{ end }}" {{- if $json.sensitive }}onclick="this.classList.toggle('toot-sens-blur-no')"{{- end }}>
{{- if $json.sensitive -}} <source src="{{ $media_attachments.url }}">
<div class="blur-text"> <p class="legal ctr">(Your browser doesn&rsquo;t support the <code>video</code> tag.)</p>
Sensitive content<br /> </video>
(flagged&nbsp;at&nbsp;origin) {{- if $json.sensitive -}}
</div> <div class="blur-text">
{{- end -}} Sensitive content<br />
</div> (flagged&nbsp;at&nbsp;origin)
{{ end }} </div>
{{ end }} {{- end -}}
{{ end }} </div>
{{ with $json.card }} {{ end }}
{{- $cardData := . -}} {{ end }}
{{- with $cardData.image -}} {{ end }}
<a href="{{ $cardData.url }}" rel="'noopener"> {{ with $json.card }}
<div class="card"> {{- $cardData := . -}}
<img src="{{ $cardData.image }}" alt="Card image from {{ $masIns }} toot {{ $id }}" loading="lazy" class="tweet-card-img" /> {{- with $cardData.image -}}
<p> <a href="{{ $cardData.url }}" rel="'noopener">
<span class="card-title">{{ $cardData.title }}</span><br /> <div class="toot-card">
{{ $cardData.description }} <div class="toot-card-image">
</p> <img src="{{ $cardData.image }}" alt="Card image from {{ $masIns }} toot {{ $id }}" loading="lazy" class="toot-card-image-image" />
</div> </div>
</a> <div class="toot-card-content">
{{- end -}} <p class="card-title">{{ $cardData.title }}</p>
{{ end }} <p class="card-description">{{ $cardData.description }}</p>
{{ with $json.poll }} </div>
{{ $poll := . }} </div>
{{ with $poll.options }} </a>
{{ range $pollOptions := . }} {{- end -}}
{{ $votesCount = add $votesCount $pollOptions.votes_count }} {{ end }}
{{ end }} {{ with $json.poll }}
<div class="tweet-poll-wrapper"> {{ $poll := . }}
{{ range $pollOptions := . }} {{ with $poll.options }}
<div class="tweet-poll-count"> {{ range $pollOptions := . }}
<strong>{{ (mul 100 (div $pollOptions.votes_count $votesCount)) | lang.FormatPercent 1 }}</strong> {{ $votesCount = add $votesCount $pollOptions.votes_count }}
</div> {{ end }}
<div class="tweet-poll-meter"> <div class="toot-poll-wrapper">
<meter id="vote-count" max="{{ $votesCount }}" value="{{ $pollOptions.votes_count }}"></meter> {{ range $pollOptions := . }}
</div> <div class="toot-poll-count">
<div class="tweet-poll-title">{{ $pollOptions.title }}</div> <strong>{{ (mul 100 (div $pollOptions.votes_count $votesCount)) | lang.FormatPercent 1 }}</strong>
{{ end }} </div>
</div> <div class="toot-poll-meter">
<p class="legal">{{ $votesCount }} votes</p> <meter id="vote-count" max="{{ $votesCount }}" value="{{ $pollOptions.votes_count }}"></meter>
{{ end }} </div>
{{ end }} <div class="toot-poll-title">{{ $pollOptions.title }}</div>
<div class="tweet-footer"> {{ end }}
<a href="https://{{ $masIns }}/@{{ $json.account.acct }}/{{ $json.id }}" class="tweet-date twitterExt" rel="noopener">{{ dateFormat "3:04 PM • January 2, 2006" $json.created_at }}</a>&nbsp;<span class="legal">(UTC)</span> </div>
</div> <p class="legal toot-poll-total">{{ $votesCount }} people</p>
</blockquote> {{ end }}
{{ end }} {{ end }}
<div class="toot-footer">
<a href="https://{{ $masIns }}/@{{ $json.account.acct }}/{{ $json.id }}" class="toot-date" rel="noopener">{{ dateFormat "3:04 PM • January 2, 2006" $json.created_at }}</a>&nbsp;<span class="pokey">(UTC)</span>
</div>
</blockquote>
{{ end }}
{{ end }}
{{- end -}}