Libove Blog

Personal Blog about anything - mostly programming, cooking and random thoughts

Tag: dev

#

#owlblogs doesn't have any user documentation yet. I want to change this but am conflicted between two approaches.

  1. Setup a typical documentation system (e.g. mkDocs) and document everything there.

  2. Integrate the documentation into the software, adding help pages served beside the blog.

#documentation #docs #dev



Microformat Categories for Hashtags in owl-blogs

I recently added hashtag support to owl-blogs. The initial reason for this was to to make post more discoverable via ActivityPub, but I found it helpful to further categories posts. The implementation was quiet simple. I use the markdown renderer goldmark which has a plugin for hashtags.

As tags are also part of microformats2, I wanted to mark the hashtags accordingly. This is currently not possible with the hashtag extension.

I've extended this to allow adding arbitrary attributes to the link tag (Related Pull Request). Until this is merged into the main repository I'll use my own version, which can be done by adding a replace directive to the go.mod

replace go.abhg.dev/goldmark/hashtag => github.com/H4kor/goldmark-hashtag v0.0.0-20240619193802-bec327f5be38

#go #dev #owlblogs #markdown #indieweb


Thumbnails for owl-blogs

I'm currently working on the thumbnail implementation for #owl-blogs and deployed the feature branch to my blog.

Thumbnails use the same file format as their parent files assuming the user already chose the best format for their images. The thumbnails are created with a width of 620px, equal to the content width of the blogs main body. If the image is already small enough the image data is simply copied.

The URL of a thumbnail can simply be generated by replacing /media/ with /thumbnail/.

I will still write some tests and see if any errors occur on my blog before merging this feature into the main branch.

#dev #blog


#

When using go-ap/jsonld, to extend the context by a term use:

jsonld.WithContext(
	jsonld.Context{
		{IRI: jsonld.IRI(vocab.ActivityBaseURI)},
		{Term: jsonld.Term("Hashtag"), IRI: jsonld.IRI("https://www.w3.org/ns/activitystreams#Hashtag")},
	},
)

Instead of:

var ApEncoder = jsonld.WithContext(
	jsonld.IRI(vocab.ActivityBaseURI),
	jsonld.Context{
		{Term: jsonld.Term("Hashtag"), IRI: jsonld.IRI("https://www.w3.org/ns/activitystreams#Hashtag")},
	},
)

The latter ignores the terms.

#golang #dev #activitypub #fediverse