Feuerfest

Just the private blog of a Linux sysadmin

Adding canonical links for category and tag pages in Bludit 3.16.2

TL;DR: I updated to Bludit 3.17.2 and this change isn't needed anymore as the Canonical plugin was rewritten and now includes canonical links for tag and category pages.

Google's Search Console has problems with my site regarding duplicate content due to "Duplicate without user-selected canonical". Which is Google's wording for:

The automatically generated site-views for your categories and tags have the same content sometimes. Hence identical content is available under different URLs.

And yes, when I checked the HTML source of these pages there is no canonical link. Despite the canonical-plugin being active.

A single post shows the following:

<!-- Load Bludit Plugins: Site head -->
<link rel="canonical" href="https://admin.brennt.net/please-don-t-remove-your-comment-section">
<link href="/bl-plugins/prism/css/prism.css" rel="stylesheet">

But for https://admin.brennt.net/tag/2fa or https://admin.brennt.net/category/it it only showed the following:

<!-- Load Bludit Plugins: Site head -->
<link href="/bl-plugins/prism/css/prism.css" rel="stylesheet">

ChatGPT to the rescue! - But with a twist!

As it is currently 6am I wasn't in the mood to dig through the code myself. So I asked ChatGPT: "How do I retrieve the tag name element in the Bludit blogging software". Only for ChatGPT to give me an extensive answer. ... For PHP-Code the canonical-plugin didn't have.

Ah.. Yes.. Typical, isn't it? Stupid LLMs, bla bla.

No, turns out on January 15th the canonical-plugins was extensively re-written. Fixing the missing canonical links. Great. So ChatGPT did indeed based it answer on the current code. I quickly searched the Bludit forum and GitHub if there is anything said about a new Bludit release but nothing showed up. And as the last release was in August 2024 I currently don't have high hopes for a release in the near future.

Instead I just copy & pasted the current code completely into ChatGPT - as providing the GitHub link didn't work - and got an answer that looked good.

<?php

class pluginCanonical extends Plugin {

    public function siteHead()
    {
        // Home page
        if ($GLOBALS['WHERE_AM_I'] === 'home') {
            return '<link rel="canonical" href="'.DOMAIN_BASE.'"/>'.PHP_EOL;
        }

        // Single page / post
        elseif ($GLOBALS['WHERE_AM_I'] === 'page') {
            global $page;
            return '<link rel="canonical" href="'.$page->permalink().'"/>'.PHP_EOL;
        }

        // Tag pages
        elseif ($GLOBALS['WHERE_AM_I'] === 'tag') {
            global $url;
            $tagKey = $url->slug();
            return '<link rel="canonical" href="'.DOMAIN_TAGS.$tagKey.'"/>'.PHP_EOL;
        }

        // Category pages
        elseif ($GLOBALS['WHERE_AM_I'] === 'category') {
            global $url;
            $categoryKey = $url->slug();
            return '<link rel="canonical" href="'.DOMAIN_CATEGORIES.$categoryKey.'"/>'.PHP_EOL;
        }
    }

}

The only new lines are the ones for tag pages and category pages.

Editing the bl-plugins/canonical/plugin.php file, reloading a category and a tag page, aaaaaaand we're green on canonical links.

Result for https://admin.brennt.net/tag/2fa:

<!-- Load Bludit Plugins: Site head -->
<link rel="canonical" href="https://admin.brennt.net/tag/2fa"/>
<link href="/bl-plugins/prism/css/prism.css" rel="stylesheet">

Result for https://admin.brennt.net/category/it:

<!-- Load Bludit Plugins: Site head -->
<link rel="canonical" href="https://admin.brennt.net/category/it"/>
<link href="/bl-plugins/prism/css/prism.css" rel="stylesheet">

Great. Now back to the main problem...

Comments

Please don't remove your comment section

For an upcoming blog article I wanted to include a link to a blog I saw in the comment section of the following blog post: James Zhan | Google De-Indexed My Entire Bear Blog and I Don’t Know Why

Only that I couldn't find the comments anymore. What!?

Turns out, as stated in the changelog of his blog, the author removed the comments section and with this, all comments.

Why!? Now all that wisdom is gone. I.. Yeah, ok. It's his blog. I get it. However I'm annoyed since I forgot to make a copy of that page in my Readeck-Instance.

*sigh* Lesson learned. I guess.

But how cool is it to have a changelog for your blog? After all it immediately answered my question.

Comments

Proxmox being cheeky

Proxmox on LinkedIn: "IQS Barcelona, a leader in science and engineering, was locked into a costly, restrictive legacy virtualization platform."

Later in their Whitepaper they name VMware explicitly.

Well... 😆

Comments

Goodbye, Bludit? Hello, Kirby?

For a few months now, I've been regularly coming back to this point where I ask myself whether I want to continue using Bludit. The latest version dates from August 2024, and there are issues with IT security-related bugs open and unresolved on GitHub.

Sure, Bludit is open source. Anyone can fork it. But Jürgen Greuter (alias: Tante) wrote back in 2013: "Host your own is cynical". In this text, he discusses why not everyone can set up and operate software "just like that" when a service is discontinued or its business model changes fundamentally.

And in this sense, I would like to note: "Fork your own is cynical"

I want to blog. I want to write down and publish my thoughts. I don't want to programme PHP or deal with problems in dozens of different browser versions. In some cases, I would also have to acquire a lot of knowledge (again) first. And the time spent for maintaining the fork? No, thank you.

I just want to be a user. Period.

And well, as can be read in the Bludit forum, the only developer (Diego) is not working on Bludit until further notice. There are apparently only minimal adjustments. Too bad. Also because security-related bugs are obviously not included.

But just as I simply want to be a user, I can understand that Diego also has a life and needs to pay his bills.

So I did a little research and came across the blogging software Kirby. Also a FlatFile CMS. You do have to buy a licence for Kirby, but at 99€ for three years, it's more than fair. And the source code is available on GitHub. So if I want to, I can dig through the code myself and see what's going on or whether there's already an issue for my problem.

What's more, the software has been on the market for over 10 years and is used by several well-known magazines and projects (e.g. OBS and Katapult Magazine). That also speaks for its reliability.

Well, I think I'll spend a weekend or so with the trial version and see how Kirby feels. The demo was nice, anyway, and didn't leave me wanting anything.

Comments

The best argument against 100% work from home I've heard so far

HomeOffice was big during the Covid-19 pandemic. And it still is. Especially in industries where the place of performance can differ from the company's headquarters without having to fear a loss of productivity.

Ironically, these sectors were subject to numerous "return to office" (RTO) initiatives from companies that had previously praised themselves for enabling all their employees to work from home full-time. Admittedly, many of these RTO strategies were actually disguised job cuts. As, for example, not everyone who moved out of high-cost of living (HCOL) areas can or is willing to move back.

Naturally "thought-leaders" and other people voice opinions on why work-from-home is bad. Despite science showing the opposite pretty obvious. But recently I encountered the first argument I can understand and support completely.

It is about the training of apprentices.

The trainer said: "Normally, we would send the apprentices to various teams for six months. This allows them to learn about networks, databases and system administration for Linux and/or Windows. Some teams had to be visited as part of the training; for others, the apprentice could choose according to their own preference and desired area of specialisation. Nowadays, however, we are having problems finding teams where enough people are present each day to actually train our trainees. Training remotely is possible (§ 28 (2) BBiG (Vocational Training Act) in German law allows remote training "to a reasonable extent", not 100%), but it isn't nearly as effective. This is especially the case since many people in IT choose to isolate themselves and don't communicate proactively enough. Hence, opportunities are lost. For example, there are fewer opportunities to provide ad hoc support for complex maintenance work on failed mission-critical systems. If you are in the office, you can recognise these situations even without access rights to monitoring and can ask to sit nearby and observe or support. But remotely? Not always."

For me, this is the first genuinely compelling argument against working from home full-time.

Comments

On microwaves, ovens and AI

A microwave can definitely be useful in the kitchen. I don't doubt that. Even if it does nothing more than an oven, it does it faster. However, you can't prepare all dishes with a microwave. For those, you still need an oven. I don't currently own a microwave and gave mine away years ago. I realised that the microwave was causing me to develop unhealthy eating habits. That's why I started cooking. My sister once gave me a wok pan for my birthday. It's by far my favourite kitchen appliance since.

Huh? You don't know what I'm talking about?

Then feel free to read this wonderful analogy written by Colin Cornaby:

In the Future All Food Will Be Cooked in a Microwave, and if You Can’t Deal With That Then You Need to Get Out of the Kitchen

Comments