-
You'll need Docker installed.
-
Run
make serve -
You'll be prompted for a Discourse API key on the first run. To get a new API key:
-
Visit https://k12-ai-infrastructure.discourse.group/admin/api/keys with an admin account.
-
For the API key permissions, the documentation says you unfortunately have to grant global permissions:
-
Select a “User Level” of Single User when generating the key, not All Users. -
Make sure to check Global Key or you will receive 403 forbidden errors.
-
-
-
Agree to
Would you like this API key stored in /root/.discourse_theme?to not be asked again, but don't commit this file. -
Select the default option
Sync with existing theme: 'KAIIP Theme' (id:5).-
AVOID the "Select a different theme" option so you don't overwrite the production theme.
-
You can confirm the ID of the production theme by visiting
https://k12-ai-infrastructure.discourse.group/admin/config/customize/themes, clicking "Edit" for the theme with the "Default theme" badge, then reading the theme ID number from the URL e.g./admin/customize/themes/4
-
-
A "Preview URL" should now be printed which you can open in a browser to preview the theme in use.
-
If you make any changes to the local theme files, the CLI should tell you they've been automatically uploaded to the Discourse server.
-
Refresh the Preview URL to see the changes.
-
Notice it's not previewing via a local server but via the Discourse server online.
-
-
Try to only edit within the
scss/customfolder to perform overrides to the base theme, rather than modifying the base theme directly. This avoid tricky merge conflicts if we need to pull in updates to the base theme later. -
Theme development docs: https://github.com/discourse/discourse/blob/main/docs/developer-guides/docs/05-themes-components/01-developing-themes.md
-
about.jsoncontains colors that get created as CSS variables that are used by the theme e.g. theprimarycolor field in this file creates a--primaryCSS variable.