all repos — blog @ d27d5aea69a84740e1d88e94acb27227f47b772a

Code and content for 5ika.ch

Add previous post link in blog, upgrade Hugo
Tim Izzo tim@5ika.ch
Sat, 24 Aug 2024 12:15:27 +0200
commit

d27d5aea69a84740e1d88e94acb27227f47b772a

parent

f8be97bb247cc645330ac13a9dfa729a75c37ffa

M content/posts/drafts/devenir-dev.mdcontent/posts/drafts/devenir-dev.md

@@ -1,6 +1,6 @@

--- Title: Comment je suis devenu dev -Date: 2024-04-27 +Date: 2030-04-27 Draft: true ---
M hugo.tomlhugo.toml

@@ -3,6 +3,7 @@ languageCode = 'fr-CH'

defaultContentLanguage = 'fr' title = 'Tim Izzo @5ika.ch' enableRobotsTXT = true +disableKinds = ['taxonomy'] [outputs] home = ['html']
A layouts/posts/single.html

@@ -0,0 +1,13 @@

+{{ define "main" }} + <h1>{{ .Title }}</h1> + {{ .Content }} + + {{ with .PrevInSection }} + {{ if .RelPermalink }} + <hr/> + <br/> + Publication précédente: <a href="{{ .RelPermalink }}">{{ .LinkTitle }} <span class="date">{{ .Date | time.Format "02.01.06" }}</span></a> + {{ end }} + {{ end }} + +{{ end }}
M layouts/shortcodes/activity.htmllayouts/shortcodes/activity.html

@@ -16,13 +16,20 @@ </div>

<h4>Lecture en cours</h4> <div> - {{ $outbox := getJSON "https://bookwyrm.social/user/5ika/outbox?page=1" }} - {{ with index $outbox.orderedItems 0 }} - <a href='{{ .id }}' target="_blank"> - {{ with index .attachment 0 }} - {{ .name }} - {{ end }} - </a> + {{ $outbox := dict }} + {{ with resources.GetRemote "https://bookwyrm.social/user/5ika/outbox?page=1" }} + {{ with .Err }} + {{ errorf "%s" . }} + {{ else }} + {{ $outbox = . | transform.Unmarshal }} + {{ with index $outbox.orderedItems 0 }} + <a href='{{ .id }}' target="_blank"> + {{ with index .attachment 0 }} + {{ .name }} + {{ end }} + </a> + {{ end }} {{ end }} + {{ end }} </div> </div>
M layouts/shortcodes/books.htmllayouts/shortcodes/books.html

@@ -1,16 +1,23 @@

<div style="margin-top:2rem"> - {{ $outbox := getJSON "https://bookwyrm.social/user/5ika/outbox?page=1" }} - {{ range $outbox.orderedItems }} - {{ if hasPrefix .content "<p>" }} - <div> - <a href='{{ .inReplyToBook }}' target="_blank"> - {{ with index .attachment 0 }} - {{ (replaceRE ` \(.*?\)` "" (replaceRE `^(.*):` "<strong>$1</strong>" .name)) | safeHTML }} - {{ end}} - </a> - <div style="margin-top:8px"><span class='date'>{{ dateFormat "2 Jan 2006" .published }}</span></div> - <blockquote>{{ (replaceRE `<p>\(comment on .*</p>` "" .content) | safeHTML}}</blockquote> - </div> + {{ $outbox := dict }} + {{ with resources.GetRemote "https://bookwyrm.social/user/5ika/outbox?page=1" }} + {{ with .Err }} + {{ errorf "%s" . }} + {{ else }} + {{ $outbox = . | transform.Unmarshal }} + {{ range $outbox.orderedItems }} + {{ if hasPrefix .content "<p>" }} + <div> + <a href='{{ .inReplyToBook }}' target="_blank"> + {{ with index .attachment 0 }} + {{ (replaceRE ` \(.*?\)` "" (replaceRE `^(.*):` "<strong>$1</strong>" .name)) | safeHTML }} + {{ end}} + </a> + <div style="margin-top:8px"><span class='date'>{{ dateFormat "2 Jan 2006" .published }}</span></div> + <blockquote>{{ (replaceRE `<p>\(comment on .*</p>` "" .content) | safeHTML}}</blockquote> + </div> + {{ end }} + {{ end }} {{ end }} {{ end }} </div>
M layouts/shortcodes/contact.htmllayouts/shortcodes/contact.html

@@ -1,6 +1,6 @@

<h3 style="margin-top:2rem">Contact</h3> <div class='contact'> - <a href="https://tooting.ch/@5ika" target="_blank" rel="me">🐘 Mastodon</a> + <a href="https://tooting.ch/@5ika" target="_blank" rel="me">⁂ Mastodon</a> <a href="https://matrix.to/#/@tizzo:matrix.octr.ee" target="_blank">🔗 Matrix</a> <a href="mailto:tim@5ika.ch" target="_blank">✉️ Email</a> <a href="/contact">🔒 Message confidentiel</a>