Files
fundor333.com/layouts/partials/micro.html
fundor333 dbda00405b Enhances Mastodon link handling and previews
Adds functionality to identify Mastodon links in Hugo markdown files, extract relevant information like instance and ID, and generate previews.

This allows for embedding Mastodon toots directly into the generated Hugo site and provides a preview text extracted from the toot content improving the user experience and content integration. It also adds a fallback in case a toot disappears to avoid broken content.

Also adds `bleach` as a dependency to sanitize HTML content.
2025-07-27 19:35:30 +02:00

28 lines
1.0 KiB
HTML

{{with .Params.Reply}}
<p><a href="{{.}}" class="u-in-reply-to u-in-reply-to"><i class="fa-regular fa-reply"></i> In replay of <span class="url-title">{{.}}</span></a></p>
{{end}}
{{with .Params.Repost}}
<p><a href="{{.}}" class="u-repost u-repost-of"><i class="fa-regular fa-retweet"></i> Repost of <span class="url-title">{{.}}</span></a></p>
{{end}}
{{with .Params.Like}}
<p><a href="{{.}}" class="u-like u-like-of"><i class="fa-regular fa-heart"></i> Like the lik <span class="url-title">{{.}}</span></a></p>
{{end}}
{{with .Params.Bookmark}}
<p><a href="{{.}}" class="u-bookmark u-bookmark-of"><i class="fa-regular fa-bookmark"></i> Bookmark of <span class="url-title">{{.}}</span></a></p>
{{end}}
{{with .Params.Rspv}}
<p><a href="{{.}}" class="u-rsvp"><i class="fa-regular fa-calendar-heart"></i> RSPV of <span class="url-title">{{.}}</span></a></p>
{{end}}
{{with .Params.Preview_text_from_reply}}
<blockquote class="u-in-reply-to in-reply-to">
<p>{{.}}</p>
</blockquote>
{{end}}
{{ if .Params.mastodon_reply}}
{{ partial "toot" . }}
{{end}}