Customizing my code repo?



  • Okay, I've got a new pile of questions I'd like to ask.

    I have a working NodeBB installation on OpenShift using this guide as recommended, and I'd like to customize it a little bit using CSS, JS and custom pages.
    I know I can do all of those things live on the ACP, wich is nice, but only seems useful when I want to change very little, for more complex stuff this would be very cluttered and unproductive.

    Where could I put custom CSS on my local repo?
    I created a custom page on my live version, but could I add and customize one directly in source?

    And the most important one, how do I make those changes persistent through version upgrades?
    I'm a bit of a git noob, and the only change I made to my repo so far are desired plugins in the package.json, wich are gone once I pull a new NodeBB version. I wouldn't want that to happen if I customize my repo further.


  • Global Moderator

    @N-kay You'll want to clone the theme you're currently using, rename it, and edit that.



  • And custom pages?


  • Community Rep

    @N-kay Same thing, you'll want to clone an existing plugin repo that has custom pages and edit them/add more. nodebb-plugin-kitchen-sink is one I use often.



  • Still trying to wrap my head around this concept, maybe I'm just stupid. Please bare with me here.

    Currently, I'm dealing with 4 git repos.
    The OpenShift and NodeBB repos on GitHub, wich I pull into my local repo, wich I then push into my 'live' repo on OpenShift.

    My live repo differs from my local repo, because it has file uploads(logo, favicon, user uploads) and probably templates and widgets I created through the ACP, right?. Or are those even part of the repo?
    Should I pull/copy these changes into my local repo? Or create a new repo for them? Or just leave those there?

    And for new themes/custom pages(/widgets?), the idea is to make a new (split or all in one? )git repo, and pull it directly into my local repo? Or as a dependency in the package.json?

    Could you maybe give me an example of what an ideal setup would look like?

    This is so confusing 😐


  • Community Rep

    You could definitely include them in the same repo. In your local, put the renamed repos in your nodebb/node_modules folder. (make sure you change the name in their package.json and plugin.json too) Then put an exclusion in your .gitignore for that directory, example !node_modules/nodebb-theme-my-persona then git add node_modules/nodebb-theme-my-persona and when you push your changes, it should include the plugin.

    What you set in the ACP is saved in the database, so it should persist. For user uploads, you should be using an external service like imgur, or the uploads may not persist between pushes.


Log in to reply
 


Looks like your connection to NodeBB was lost, please wait while we try to reconnect.