New lunisolar year, new features (hey look! I'm doing the thing)

29 January 2025

I rang in the Gregorian new year with a new site, and so it's fitting to ring in Chinese New Year with a number of enhancements to it. Most of them are back-end improvements, but I also added structured data for rich snippets and search engine optimisation. I also added some advertising banners to everyone's (and my own) chagrin.

In reality I just started construction of the entire site over. I built it using the Drupal CMS release candidate before I understood how recipes worked, and that led to some issues when I wanted to enable SEO Tools after I'd already modified too many things. I didn't want to work around it considering how little I'd actually done up to that point and because I wanted to utilise the full feature set.

Metadata (for our future AI overlords)

Website metadata, also called structured data, is just data about data on your website. If you inspect the source of this page and look at the header, it's a lot of <meta> tags with the same 10 pieces of information repeated with half a dozen slightly different names or properties. Then there are one or more <script> tags containing JSON-LD with even more metadata.

Now I'm talking about the data about data which will be in the data about data of this very page. It all seems a bit silly, but I digress.

Thankfully, I didn't need to go look up all those different properties to get nice little previews in Google Search and all the other popular advertising platforms. The Drupal CMS Recipe called SEO Tools included the Metatag module. I'd used the module previously, but the amount of metadata has expanded since last I set it up and some tags can be a bit more ambiguous.

Sitemaps (also for the robots)

The sitemap modules included in the SEO Tools recipe, Simple XML Sitemap and Sitemap, did all the heavy lifting here. I just tweaked some values as I saw fit. Technically one of those is for people, but I don't think I've ever looked at a sitemap and obviously everyoneconsumes the internet in exactly the same way I do. But if I'm wrong and those people do exist, it took so little effort that even just one person looking at it justifies the time spent. Honestly, it took longer to look up the links, then write and rewrite this silly little paragraph then it did to configure those modules.

robots.txt (robots is literally in the name)

SEO Tools also includes RobotsTxt module. That one took an extra few minutes of searching to get configured. Not in the UI, that's fine. The problem is that when you're using Composer to manage your Drupal project (and you should be), it copies the robots.txt file when it copies the scaffolding files. You have to add the following to your composer file to keep it from doing that.

{
	"extra": {
		"drupal-scaffold": {
			"file-mapping": {
				"[web-root]/robots.txt": false
			}
		},
	},
}

If you don't already have files configured in the file-mapping key – because this will overwrite it completely – you can run the following command to add it to your composer file.

composer config extra.drupal-scaffold.file-mapping --json '{"[web-root]/robots.txt": false}'

All hail our future AI overlords! Long shall they reign!

(just in case, ya know?)

AI integration

While we're talking about it, Drupal CMS also has surprisingly extensive AI integration. I'm still digging through it, but I promise I have no intention of using it to produce even more AI slop. As I mention in What are we even doing here? I hope to use this blog to help Future Curtis solve problems Past Curtis already solved using AI tools. There's not much more to say on it right now. I don't have a GPU to try it with so even testing stuff takes an eternity. I've tried to give OpenAI money but they won't take it. I'll just get an older (compatible) NVidia Tesla card on eBay at some point. My current budget for this is like $0 because this is a novelty and I have other things I want and need more.

Advertising

So I added some banner ads. I thought this was going to be a very simple task. I had used Revive Adserver back when it was still called OpenX, so I had an idea of how to set it up. I found the Revive Adserver module which looked like it would really simplify the integration process on the Drupal side. And to its credit it worked great after I fixed a required library and added it as a custom repository in my composer.json.

Ad blockers

Everyone hates adverts. I hate them too. However yaboi's gotta eat and buy things to make more content so you come back where you'll view more ads. It's truly a viscous cycle, but until I get enough regular contributions to get rid of them, I'd really appreciate you allowing ads on this site. If you use Brave Browser, you can contribute to me as a verified creator if you want to leave the built-in ad blocking enabled. Visit my Contribute page if you'd like to help make the ads go away.

Other things

Some other little improvements include:

  • adding a status taxonomy reference field to Project entity types,
  • adding a related post entity reference field to Project entity types,
  • adding a bibliography link field to all content entity types,
  • adding an attribution link field to all media types, and
  • fixing differences with how Image and SVG Image media types display. 

Still to do for people (to feed into more robots)