TechLifeWeb

Note 2025-10-17T23:35:13.000-07:00


Published by 
Scott Kingery
 on 

#11ty follow-up: I pull posts (PESOS) from Mastodon to my own site via 11ty/import plugin. I then have some automation that crossposts to Bluesky via webmention and brid.gy. Earlier I noticed that hashtags weren't being sent as links to Bluesky. Thanks to @snarfed I learned that is because I needed to have the class "p-category" on my hashtags. Well that's fine but I'm pulling these in automagically and they aren't formatted that way. Changing the code by hand after import is a non-starter. Fortunately, I was able to figure out how to create an 11ty filter that will watch and change the code at build time. Here's the filter that changes "class='mention hashtag" to "class='mention p-category"

  eleventyConfig.addFilter("fixHashtagClass", function (content = "") {
  return content.replace(
    /class="mention\s+hashtag"/g,
    'class="mention p-category"'
  );
});
et voilà, updated posts that will end up as linked hashtags on my Bluesky account.