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.
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.
Hi. I’m trying to follow these instructions but I keep hitting a wall. After adding the API key I see the following:
/usr/local/lib/ruby/gems/3.2.0/gems/discourse_theme-0.7.3/lib/discourse_theme/cli.rb:100:in `run': undefined method `exists?' for Dir:Class (NoMethodError)
FileUtils.mkdir_p dir unless Dir.exists?(dir)
^^^^^^^^
Did you mean? exist?
from /usr/local/lib/ruby/gems/3.2.0/gems/discourse_theme-0.7.3/bin/discourse_theme:6:in `<top (required)>'
from /usr/local/lib/ruby/gems/3.2.0/bin/discourse_theme:25:in `load'
from /usr/local/lib/ruby/gems/3.2.0/bin/discourse_theme:25:in `<main>'
Is discourse_theme watch no longer live-reloading? It used to refresh my theme when I saved it but now I have to manually refresh my tab. Nothing in the console that would point to why.
discourse_theme watch는 정상 작동하며, 제 변경 사항이 미리보기 URL에 동기화되고 있습니다. about.json에 color_schemes를 추가한 테마를 스캐폴딩했습니다. /me/theme의 테마 선택 상자에는 해당 스킴이 표시되지만, 실제로 스킴/팔레트를 선택하여 볼 수 없고, 제가 직접 지정하지 않은 기본 스킴인 "Light"에 고정되어 있습니다.