自分のサイトに GitHub の変更を適用する

I try in a new topic instead.

I did add a few line of change to some githib files based on this topic:

The line is added to the github pull request but I guess they will not be adapted to the release

My question is without knowledge of github how do I get these changes to work on my own setup?

I did try to add

https://github.com/frold/onebox.git

to my app.yml - but it doesnt seems like the changes are adapted to my site…

What else can I try?

I just want to add 2 lines of changes to my site, but it seems like a marathon :smiley:

If I understand what you’re trying to do correctly, you will need to create a plugin to make that modification (or fork the entire discourse repo and use that in your app.yml, but that is absolutely not recommended).

A plugin to get use of 2 lines of changes… that seems a little overkill… :crazy_face: (and far over my level) :wink:

I know, “plugin” sounds like overkill because it’s a big word. But all a plugin really does it modifies/amends discourse’s code, which is exactly what you’re trying to do, right? Of course you can do so much more with plugins than change 2 lines of code, but changing those two lines is entirely possible and not overkill at all. It’s pretty much the same as what you’ve tried, only the “proper” way. It’s so easy that even I was able to do it:

Check out that topic and see if you can make it work for your case.

@tophee が言ったように、プラグインは複雑である必要はありません。とてもシンプルなプラグインの例をもう一つ紹介します(これはサイトの設定で許可される最大値を増加させるものです): https://github.com/jomaxro/discourse-plugin-site-setting-override。


ソースコードを直接変更することがなぜ悪い考えなのか、個人的な経験から話させてください。Discourse で働く以前、私は Discourse を社内で利用している企業に勤めていました。その企業は Discourse を WordPress インストールと連携させていましたが、WP と Discourse を接続するために API を使う代わりに、Discourse にカスタムルートを追加することを決めました。その方法は、routes.rb ファイルをコピーし、新しいルートを追加してから、Discourse がアップデートするたびに routes.rb ファイルを上書きするというものでした。Discourse 側で新しいルートが追加されても、上書きされている変更済みの routes.rb ファイルによってそれらは「削除」されてしまいました。最終的にホームページのルートが変更され、アップデート時にそれを上書きしてしまったため、Discourse が頻繁にエラーを発生させるようになりました。

そのファイルが変更されたのは 2016 年半ばのことでした。エラーが発生し始めたのは 2017 年半ばです。エラーの原因を特定するのにほぼ 1 週間かかりました。私たちは「最近」何か发生了变化したのだと思い込んでいたため、1 年間触られていなかったものが原因だとは考えなかったからです。

要約: ファイルを直接変更しないでください。今日問題がなくても、予想もしない時に戻って襲いかかる可能性があります。

I might seems easy to make a plugin, if you are a coder.

As a non coder - I have no idea about where to start to solve my issue…

What files are needed? what snippets to paste in the files? where to and how to put a plugin at git hub? etc…

Im totally blank…

Things are easy if you know them… the down side of Discourse is the rather steep learning curve… It is very much for coders to coders.

I am not a coder either. Did you read the topics linked in the previous posts?

There is always room for improvement, but I don’t think that’s a fair assessment. You are trying to customize discourse beyond what is foreseen in the UI (which is very easy to use). If you want to “hack” a software, you can’t really blame it for that being difficult.

Besides, the community here is usually quite helpful…

Check out @angus’s awesome guide at Learn how to start building stuff for Discourse if you're newbie (like myself). For plugins @eviltrout wrote up a series of howto topics that start with Developing Discourse Plugins - Part 1 - Create a basic plugin