prry

Adding Indieweb features to a PureBlog Site

In my previous article I indicated that I would follow up shortly with an article on posting to webmention, bluesky and mastodon directly, without requiring a third party service.

I came to realise though that my content structure is so bespoke, that it did not make sense to unwind my own build. Instead what I needed to show was how to implement this on a vanilla PureBlog install, respecting as much of the PureBlog core as possible.

I've spent the last few days simplifying what I've built on my site into just 6 files, and 3 sets of scripts ready to implement within the admin module. Once implemented, and customised to the site's webmention.io endpoints, social links, and bluesky/mastodon developer tokens, the site will have the following features:

  • Implements Microformats2 on posts and blog page.
  • Implements author h-card in post meta and footer - powered by existing PureBlog settings fields.
  • Implements first image in post as opengraph image, and first paragraph as opengraph description where the post description field is left empty.
  • Shares posts to Bluesky, Mastodon and via webmention directly, including the first 4 x image files attached to the post.
  • Receives webmentions, and fediverse interactions as webmentions through Brid.gy, via webmention.io, and displays those interactions on the post to which they link in an opinionated style.
  • Displays syndication links of shared posts.
  • Converts YT video embeds to automatically use the nocookie variant.
  • Includes Kev's PureBlog code to lightly obfuscate the site email address on a reply by email button.

Much of the above is not my own work, the Mastodon direct post and email obfuscation heavily utilise projects identified on pureblog.org. I have also used AI to simplify my own build into this project quickly - if you avoid all things AI, this project is not your bag.

You can find indieBlog at my subdomain indieblog.prry.uk, and the source at Codeberg.

Hope this helps, lemme know what you think. Now I'm going to get back to writing stuff, though taking inspiration from this project I would like to simplify some of my own build.

indiewebpureblog

7 responses

werschreibt
Thanks for all the work! Will have a closer look soon. Please note, PureBlog should be written as Pure Blog.

Reply

Ulf
Thank you for your work! I was unable to integrate the files into my existing project (error 500). Even in a fresh installation (https://indie.liedersaenger.de) , I get error 500 after uploading hooks.php.

Reply

In reply to Ulf

Lee Perry
Hi Ulf,

When do you get the 500 error, and does an error_log file appear in any of the folders?

I've just spun up a quick install, copied the file structure into the root, and the code snippets into admin. I've not put the bsky and mastodon app passwords in yet, but I cannot currently replicate - see https://code65.co.uk.

To install this into an existing file, other than the .post.php file which is novel, the contents of the files would need to be merged into the existing files in content and config, where they already exist, which is a little trickier.

Lee

Reply

In reply to Lee Perry

Ulf
Hi Lee, thanks. Unfortunately, I don't have a log file documenting the error. It occurs when accessing /admin and when clicking on the article. Do I need to delete config.php in the confing folder? Thanks a lot and good night!

Reply

In reply to Ulf

Lee Perry
Hi Ulf,

No need to replace config.php - that file is deliberately untouched.

Would you check the tokens at the top of hooks.php, suspect error lies there? they should be formatted as follows:

define('MASTODON_INSTANCE', 'https://troet.cafe');
define('MASTODON_TOKEN', 'xxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxx');
define('BLUESKY_HANDLE', 'liedersaenger.de');
define('BLUESKY_APP_PASSWORD', 'xxxx-xxxx-xxxx-xxxx');

Lee

Reply

In reply to Lee Perry

Ulf
Yes, the bsky handle was missing a ' and a ) Now it works. Thank you and good morning!

Reply

In reply to Ulf

Lee Perry
Excellent news!

I might restructure this to call in from an external reference so that that the define blocks cannot be broken in that way.

Really pleased this is working...

Reply

Leave a reply

Have your own site? Link to this page and send a webmention — it'll appear here. Otherwise, use the form.