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
The new autocomplete results:
The new cooked style for hashtag autocompletion, which closely matches the @mention style.
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 :
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.