Customization of discourse


(Sadda Qayyum) #1

I am trying to customize few views in the code i have committed the changes in my repo(clone of discourse) and updated app.yml with :


  • exec:
    cd: $home
    - git remote remove origin
    - git config --remove-section branch.master
    - git config --remove-section branch.tests-passed
    - git remote add origin Bitbucket
    - git checkout master
    - git pull origin master
    - git reset --hard origin/master

but stil when i rebuild app it keeps pulling from discourse repo. Please help me understand how to deploy my changes.


(Jay Pfaffman) #2

You don’t want to fork. You want to make your changes in plugins.

If you fork, you will never be able to take advantage of new versions of discourse.

(Joshua Rosenfeld) #3

Speaking from personal experience (unfortunately), I want to emphasize what Jay said. Please, please, PLEASE don’t fork Discourse. I was tasked with getting a live Discourse instance up to date that was forked from the main repo 2+ years ago, and it was painful. I spent way too many hours trying to merge thousands of commits, resolve conflicts, do testing, and then fix deployment issues. Sadly, since it is still a fork someone will need to do that all over again every time it gets updated.

(Sadda Qayyum) #4

ok thanks for the replies guys i understand what you saying but i need to know how can i implement my changes.

(Eli the Bearded) #5

There’s a series of posts on how to make plugins:

(Sadda Qayyum) #6

What if i dont want the new changes from discourse an i want to deploy my clone to server? I know how to do it for RAILS, but with dockers it keep pulling code from open source repo of discourse is there a way i can force it to use my repo??

(Jay Pfaffman) #7

Then you will probably need to get another community to help you.

(Sadda Qayyum) #8

ok thanks. Can i comment few lines with a plugin?

(Jay Pfaffman) #9

Plugins can do most anything.

See these topics.

(Sadda Qayyum) #10

ok i am following this Beginner’s Guide to Creating Discourse Plugins - Part 1 guide i don’t see any instructions to deploy changes on server. Can you please guide me how to deploy new created plugin on server?

(Jay Pfaffman) #11

Look at any example in the #plugin category. Pretty much every plugin explains how to install plugins. Also, if you look in app.yml you can copy the git clone line for the docker plugin.

(Sadda Qayyum) #12

i have added my changes in in new folder in plugins folder plugin.rb

# name: ui-customization-plugin
# about: UI customization
# version: 0.0.1
# authors: sadda

and then there is assets folder which contain a stylesheet with following content

    border: 1px solid red !important;
    color: yellow !important;

But changes are not appearing on my local machine when i restart server


(Sadda Qayyum) #13

its loading but i cant see the changes

(Sadda Qayyum) #14

Its working now i had to clear cache thanks a lot man.

(Jay Pfaffman) #15

All you wanted to do was customize CSS?

Maybe have a look at this.

(Sadda Qayyum) #16

Actually i wanted to comment out some text in views i don’t know how to comment out existing view code with plugin so i figured to hide them using css.

(Jay Pfaffman) #17

It turns out that you’re not the first person who’s wanted to do that. It’s quite easy to customize all of the CSS without forking Discourse and without a plugin.

(Sadda Qayyum) #18

and how can i do that?

(Jay Pfaffman) #19

Did you look at the link I provided?

See also: /admin/customize/themes and click on “new”.

(Sadda Qayyum) #20

yes got it tested and it works thanks.