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.
Привет. Я пытаюсь следовать этим инструкциям, но постоянно упираюсь в стену. После добавления API-ключа я вижу следующее:
/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>'
Есть какие-то идеи, почему это происходит?
Заранее спасибо.
Команда discourse_theme watch больше не обеспечивает автоматическую перезагрузку? Раньше она обновляла мою тему при сохранении, а теперь мне нужно вручную обновлять вкладку. В консоли ничего нет, что могло бы указать на причину.
Команда discourse_theme watch работает и синхронизирует мои изменения с URL предпросмотра. Я создал каркас темы, добавив color_schemes в about.json. Они отображаются в выпадающем списке темы по адресу /me/theme. Однако я не могу выбрать схему/палитру и просмотреть её; вместо этого у меня зафиксирована схема по умолчанию под названием «Light», которую я не указывал.
Мои именованные цветовые схемы из about.json также не отображаются в разделе /me/preferences/interface.