This topic will walk you through how to use the Theme CLI with our Theme Creator site to develop a theme and preview your changes on a live Discourse site.
-
Sign up for an account here on Meta if you haven’t already
-
Install the Theme CLI via the instructions here
-
Create a new theme on Theme Creator by:
-
Clicking Install, and selecting the “Create New” option.
-
Giving your theme a unique name (you can ignore the color scheme for now).
-
Click advanced, then edit locally, and retrieve API key.
Copy the API key that is generated.
-
Go back to your command line and type
discourse_theme download example-folder
, where example-folder is where your theme will be stored locally. Follow the prompts.-
Enter
https://discourse.theme-creator.io
as the root URL of your Discourse site. -
Enter your API key from the previous step when prompted.
-
Continue following the prompts and select the theme you created in step 4.
-
Enter yes when asked if you’d like to start watching your theme.
-
-
Now your local theme folder is being watched for changes, which will be automatically uploaded to Theme Creator. You can open a preview of your theme by clicking preview in your theme’s settings on Theme Creator.
-
To stop watching for changes, hit ctrl + c in your command line window. To start watching for changes again type
discourse_theme watch example-theme
.
You now have a local theme directory you can edit and see your changes live!
For an in-depth look at how themes are structured and what you can do, check out our Beginner's guide to developing Discourse Themes
This document is version controlled - suggest changes on github.
Last edited by @JammyDodger 2024-05-26T12:24:14Z
Check document
Perform check on document: