Updating Discourse with custom modification

(Flaviu) #1

Is there any way in which I can configure/add some templates-yml files so that when I update from the Discourse user interface these changes to apply to the source code before the update script recompile the entire software.

I managed to do this at the initial installation by adding a new template which is changing some of the things in the source code, but, if am doing an update directly from the user interface, it looks like that script is not loaded/run anymore.

Is there a way in which I can run a script after the code is downloaded from git but before is compiled in case of an update?


(David Taylor) #2

We strongly advise against modifying the discourse source code, as it can cause major issues when you come to upgrade (as you’ve found). Instead, you should use themes, and if you need something more advanced, plugins.

To change handlebars templates, you can use a theme. We have some extensive documentation on that here;

You mentioned “yml files”. Can you expand on which YML files you are changing? If you are modifying the translation files, you’ll be pleased to know that translations can be updated from the Discourse administrator panel, and that those changes persist across upgrades.

(Flaviu) #3

This is related to my other question that you have already answered. I am interested in changing the url of the logo link. I can do this at the first install, and probably I could do this at subsequent upgrades if I could know which files from the /templates/files.yml are executed at an upgrade event initiated from the Discourse admin.

It would be great if I could get an answer to this specific question. Is there any way in which I can execute a file from templates/file.yml during an update?

I understand this is not a recommended behavior.

(Mittineague) #4

Wasn’t that answered in your other topic?

(Flaviu) #5

yes, it was after I asked this question.

Still, just for my curiosity I would like to know if it is possible,

Configuring the logo/home link in a subfolder instalation