Skip to content

feat(syndicator-mastodon): add categories to status as hashtags - #875

Merged
paulrobertlloyd merged 1 commit into
getindiekit:mainfrom
rmdes:feat/mastodon-category-hashtags
Aug 16, 2026
Merged

paulrobertlloyd merged 1 commit into
getindiekit:mainfrom
rmdes:feat/mastodon-category-hashtags

Conversation

@rmdes

@rmdes rmdes commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator

Closes #832.

Adds an includeCategories option to the Mastodon syndicator. When enabled, a post’s categories are appended to the end of the status, where Mastodon renders them as hashtag links:

I ate a cheese sandwich, which was nice.

#lunch #cheesesandwiches

Placing them at the end matters for the reason given in the issue: hashtags only get Mastodon’s link styling when they aren’t buried mid-sentence, which is why the reporter’s manual workaround didn’t quite work.

Behaviour

Categories are normalised to something Mastodon will actually recognise as a hashtag:

  • characters outside letters, numbers and _ are removed, so cheese sandwiches becomes #cheesesandwiches and web-design becomes #webdesign (a hyphen would otherwise end the hashtag)
  • only the last segment of a hierarchical category is used, so holidays/family trips becomes #familytrips
  • duplicates and categories that normalise to nothing are dropped

Hashtags already written into the post content aren’t repeated, so anyone currently using the workaround in the issue won’t end up with them twice.

Where a character limit applies, the hashtags are counted towards it and the content is truncated to leave room, rather than the status overrunning.

Default

I’ve defaulted this to false, following includePermalink, so nobody’s syndicated posts change unless they opt in. That said, the issue is phrased as an expectation rather than a feature request, so if you’d rather it default to true that’s a one-line change — happy to switch it.

Tests

Nine tests added to test/unit/utils.js covering the option on and off, normalisation, hierarchical categories, deduplication, not repeating hashtags already in content, and staying within the character limit. The existing tests are unchanged and still pass.

Notes

This only covers syndicator-mastodon. #832 is about Mastodon specifically, but the same thing presumably applies to other syndicators — I’ve not touched those here.

Adds an includeCategories option which appends a post’s categories to the end
of the status, where Mastodon displays them as links. Off by default, so
existing syndicated posts are unchanged.
@eclecticpassions

Copy link
Copy Markdown
Contributor

Thank you, Ricardo! The fixes sound perfect. 🙏

@paulrobertlloyd paulrobertlloyd added the plugin-syndicator Syndicator plug-in label Aug 16, 2026
@paulrobertlloyd
paulrobertlloyd merged commit 5a7d89e into getindiekit:main Aug 16, 2026
1 check failed
@paulrobertlloyd

Copy link
Copy Markdown
Collaborator

We could possibly add the same mechanic to the Bluesky syndicator, though I’m not sure if tags are as much of a thing on that platform. Happy to accept a companion PR to add it to that plug-in too, if anyone wants it.

paulrobertlloyd pushed a commit that referenced this pull request Aug 16, 2026
Companion to #875, which added the same option to the Mastodon syndicator.

Appends a post's categories to the end of the post text when the
includeCategories option is enabled. createRichText already runs
detectFacets, which turns the resulting #hashtags into
app.bsky.richtext.facet#tag entries, so no facets are built by hand.

Off by default, so existing syndicated posts are unchanged.
paulrobertlloyd pushed a commit that referenced this pull request Aug 16, 2026
Companion to #875, which added the same option to the Mastodon syndicator.

Appends a post's categories to the end of the post text when the
includeCategories option is enabled. createRichText already runs
detectFacets, which turns the resulting #hashtags into
app.bsky.richtext.facet#tag entries, so no facets are built by hand.

Off by default, so existing syndicated posts are unchanged.
@rmdes

rmdes commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator Author

We could possibly add the same mechanic to the Bluesky syndicator, though I’m not sure if tags are as much of a thing on that platform. Happy to accept a companion PR to add it to that plug-in too, if anyone wants it.

Hashtags are definitely alive and kicking on Bluesky, and in some way better than RIP Twitter or Mastodon, when you click on a hashtag on bluesky, it allows you to check that account use of that hashtag or anyone usage of that hashtag on the platform
image

its really nice !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin-syndicator Syndicator plug-in

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Indiekit category (tags) not shown in Mastodon syndicated posts

3 participants