ערוך קוד

סיכום מבוסס בינה מלאכותית

In a discussion titled “Edit Code” under the Dev category with the tag “docker,” Juraj_Štefánik seeks advice on modifying Discourse code beyond what plugins or CSS in admin panels allow, considering editing the Docker container. merefield suggests detailing the desired changes, noting that plugins and theme components are designed to persist through container rebuilds. For Ruby API changes, a guide on creating plugins is recommended; for JavaScript, theme components suffice. Juraj_Štefánik gives examples: adding a GDPR page under the “About” menu and changing the email address shown. merefield recommends using the Page Publishing plugin to add static routes, or simply renaming “Privacy” to “GDPR” via Customize > Text and editing its content through the UI. Email and link updates can be made directly in settings, and CSS in a theme component (preferably managed via GitHub) can hide elements. The consensus is to avoid direct container edits in favor of Discourse’s extensibility tools.

HI, please, I would need to change the code because I need to make a few changes that can’t be made using plugins or the CSS in the admin panels.

So far, I see the possibility in the docker container and then upload it somehow back.

Can you advise me any other solution?

I would be very grateful for any answer.

Thank you

Could you describe the changes you want to make in more detail?

Discourse team and the architects of Ruby & Rails (etc.) have gone a long way to make sure you can change code in plugins.

The whole point of plugins and theme components is that their changes survive rebuilds of the container.

Start here if you code changes includes Ruby API: Developing Discourse Plugins - Part 1 - Create a basic plugin

If Javascript only you can usually get away with a Theme Component. Developing Discourse Themes & Theme Components

For example, I get here via the menu button on the top right - About, and I already have some modified or hidden a few things using display none, but if I wanted to add something here some new page led gdpr how do I do it? or lower than the email red how do I change to another email ??

Consider:

to add additional static routes, but why don’t you just change “Privacy” to “GDPR” in Customize → Text and then alter that document how you see fit to add GDPR content? You can already just edit that text almost like a normal Topic through the Discourse UI. Easy!

You can update the email and links in settings:

If you need to hide anything, yes you can do that in CSS you add to a Theme Component (best managed from a GitHub repo)