Setting up a solid workflow for custom theme development

Hello everyone!

I’m new here but I’d like to give Discourse a try before deciding what platform to build my community on, since I consider this the most exciting prospect out there.

Currently I’m having trouble setting up a consistent workflow.

Preferably I’d like to either:

a) code in the cloud using an IDE like Cloud9 (https://c9.io)
or
b) code locally using something like Atom

…and then preview the changes using live refresh for HTML/CSS/JS.

Whenever I’m satisfied I just push a new commit to Github. Then I import the theme remotely to my hosted Discourse install (I’ve chosen Nodechef https://nodechef.com/discourse-hosting for now).

As far as I understand it I will need to be using the Discourse Theme CLI (Discourse Theme CLI (console app to help you build themes)) but I’m having trouble setting everything up.

Reference Post: Discourse Theme CLI (console app to help you build themes)

Any help would be greatly appreciated!


Notes:

  • I’ve read the basic & advanced guides to Discourse theme development several times
  • If everything goes well I will probably be releasing the theme to the community probably using Theme Creator? (https://theme-creator.discourse.org)
  • I am not a professional coder and I don’t have much Ruby experience, I’m just a regular front-end designer/dev looking to learn and build cool stuff
2 Likes

If you want to use Cloud9 to work on Discourse stuff, ask for an invite to The Janitor. It provides a Cloud9 IDE with a dev-mode Discourse.

2 Likes

Thanks, that sounds good.

I get an error when trying to log in: Error: Failed to email you and at sign-up I get Already in the waitlist.

Is the registration system in a manual approve mode or am I doing something wrong?

EDIT: Just saw that I have to wait a bit for approval @ Welcome to the Janitor community forum - Janitor forum

The theme cli is the way to go. You just need somewhere that you can run it. It doesn’t matter where you’re hosted. You just need to resolve your API key problem.

1 Like

I’m an admin, I triple checked. See attached images.

1 Like

Tried again with no success on a fresh install using a new API key. Not sure what’s going on really.

What’s the second best way of doing things if I can’t get the Discourse theme CLI to work?

Any ideas would be appreciated, thanks.

Using the built-in editor in Admin > Customize > Themes might be the best way if you can’t get the CLI to work. The CLI was built because there really wasn’t an ideal way to develop themes for Discourse previously, so I’d like to help you get that worked out if possible.

Are you able to install Discourse locally using any of the methods here: Topics tagged dev-install? You can point the Theme CLI at localhost, which might help avoid any of the network issues you were running into.

Have you tried using a Discourse instance that’s not hosted by nodechef? I wonder if there’s a peculiarity with them specifically (I’m going to try an install there and see if I run into any issues).

Update: Just tried using nodechef and didn’t have any issues with getting the CLI up and running.

5 Likes

I’d rather not use the theme editor, it’s too basic and I also need to change the markup (add/remove functionality) which is impossible via the editor. I agree that the CLI is the way to go, that’s why I’m still trying to make it work.

No, I have not tried other hosts. Looking into options currently.

Let me know if you find out anything, I’d appreciate it!

Interesting. Maybe I should just delete the instance and create a new one on Nodechef?

Not sure if I will be charged again if I delete & create a new one though.

1 Like

Status update (for anyone interested/similar situation):

With @awesomerobot’s assistance we’ve debugged the issue and it seems that Nodechef randomly installed an older version Discourse 2.0.0.beta3 on my account instead of Discourse 2.0.0.beta 4 which is required for the CLI.

Also important to note is that if you delete your instance and try to do a fresh install, Nodechef WILL INSTANTLY CHARGE YOUR CARD AGAIN, even if you’ve paid a minute ago for the last forum instance.

As for my path, I’m currently considering doing a self hosted install, probably using one of the Recommended Hosting Providers for Self Hosters.

7 Likes

See

3 Likes