Adding tags to topics created with Discourse Embed feature
jordan-violet is looking to add tags to topics created with the Discourse Embed feature, which will be used in different areas of their MKDocs site documentation.
The goal is to have one embed for all documentation pages, but with different tags for each doc. For example, /docs/doc1 would have a #docs and #doc1 tag, while /docs/doc2 would have a #docs and #doc2 tag.
pfaffman suggests using the Discourse Automation plugin or a custom plugin to achieve this. The tag could be determined by parsing the URL of the embedded location.
pfaffman reiterates that an automation or custom plugin would be necessary to add tags to the topics, using the URL to determine the tag.
What is an “area?” The embed setup posted topics in a single category.
Discourse Automation might help? It has a script to add a tag, so maybe it can help. Or maybe you’d need to do something with the API to move the topics, or have a plugin that used add_model_callback(Topic, :after_create) to identify the new topics from your site and re-tagged them.
So it would be one embed for all documentation pages, but embeds in different docs would, ideally, have different tags. For example, the following docs structure:
I think I understand. If you want them tagged, you’d need to do that with the automation plugin or a custom plugin as I suggested before. I guess you’d get the tag by parsing the URL of the place it’s embedded.