Discourse has overhauled its hashtag system to support linking to chat channels via hashtags (e.g., #general::channel), alongside categories and tags, with improved autocomplete and visual styling. The new design includes distinct icons for each result type, prioritized search results (e.g., categories in posts, channels in chat), and a cooked style resembling @mentions. The feature is now enabled by default across all sites, with visual enhancements like colored icons and subcategory styling. Accessibility concerns were raised by hellekin, prompting martin to commit to adding aria-labels. For existing content, old hashtags won’t update until posts are rebaked; users can trigger this via rake hashtags:mark_old_format_for_rebakeCanapin confirmed this works on production without bundle exec. The legacy hashtag code will soon be removed. This update is live on Discourse Meta, encouraging users to explore #announcements or release-notes. mcwumbly demonstrated linking to chat channels from posts and chat messages, while AquaL1te and JammyDodger discussed rebaking strategies for consistency.
Discourse has supported linking to categories (#announcements) and tags (release-notes) for a long time using hashtags (#). With the introduction of Discourse Chat we wanted to be able to link to chat channels with hashtags, which required some overhauling of how the system works to allow for channels to be suggested with autocomplete and also to cook in posts and chat messages. We also decided to take the time to overhaul the design of the autocomplete menu and cooked hashtags.
A summary of the changes included with this overhaul:
The ability to search for chat channels if you have chat enabled
Hashtag search results prioritise exact matches based on the slug, and depending on whether you are using them in a post or a chat message, we prioritise different types of results (e.g. categories are at the top in a post, but channels are at the top in chat)
A distinct icon is shown for each result
A new style for cooked hashtags which include the distinct icon
You can opt-in to using this new version of hashtag autocompletion and cooking by enabling the enable_experimental_hashtag_autocomplete site setting on your Discourse site:
We expect to make this the default in the new year, meanwhile this is still considered an experimental feature, so there are still a few things to fix and refine.
This feature is now enabled on Discourse Meta as well
An update here – we’ve now made this the default for all sites, after making some changes around how the hashtags are cooked. We now also show colours for the icons including the original subcategory styling :
Thanks for noting this, this is a great point. At the very least some aria-labels on each hashtag are in order. I will try to get a commit for this this week.
Old topics won’t use the new format for tags and categories until the HTML is rebuild. Is there a way to safely rebuild all topics to make the UI consistent? Maybe with rake?
Without bundle exec, seems to work on a production site
root@Canapin-app:/var/www/discourse# rake hashtags:mark_old_format_for_rebake
Finding posts matching old format, this could take some time...
[!] You are about to mark 0 posts containing hashtags in the old format to rebake. [CTRL+c] to cancel, [ENTER] to continue
Done, rebakes will happen when periodical updates job runs.