Split up theme Javascript into multiple files

Yeah. It’s hard to make sense of. I prefer not to think about the number of times I spent 3 hours on something only to find that I named something wrong or put it in the wrong place, or sometimes, forgot to include it one of the seemingly many ways there are to do that (in plugin.rb, in an include in a js file–what path? Do I need an extension?)

Best is to use Install the Discourse Theme CLI console app to help you build themes and have it create a theme Skelton for you. And it makes it very easy to debug since it automatically uploads it to your server (a plain old production server) and (usually) reloads your browser automatically.

No idea what or if there is a difference (I don’t think so? But I have little clue). I would use the one that is in the theme Skelton.

There is a repo called all-the-themes. You can get that and search it for examples. And always use the one that’s been changed more recently.

3 Likes