content

After updating Discourse for t/suki to the latest version, I see the following error message in the admin console:

[Admin Notice] Theme 'Godot Tweaks' contains code which needs updating. (id:discourse.script-tag-discourse-plugin) (learn more)

It looks like in this case, Godot Tweaks is using <script type='text/discourse-plugin> in common/head_tag.html.

To fix this, I'm supposed to move this script to its own file. However, the official Discourse post about this only describes how to do this for a locally installed plugin which you can edit directly in the Discourse interface, so I'm not sure how to do it for a git repository.

After some searching around, I finally find this post which says the javascript file needs to go in the javascripts/ folder, and can be named anything (some content elided):

To create a theme you need to follow a specific file structure. These are the files you may include:

javascripts/{anything}.js
javascripts/{anything}.hbs
javascripts/{anything}.hbr

I tried doing javascripts/gdscript.js, but this didn't work. I did notice, however, that one of my custom components had very similar boilerplate code to the migration example, so I exported that. I observed that it placed the javascript file at javascripts/discourse/api-initializers/theme-initializer.gjs. Moving/renaming the javascript to that location fixed the issue.

meta

created:

backlinks: t/suki logs

commit: b086b2d9