Discourse Theme CLI-App installieren, um Themes zu erstellen

Die discourse Discourse Theme CLI ist ein Ruby-Gem, das es dir ermöglicht, bei der Entwicklung von Discourse-Themes und Theme-Komponenten deinen bevorzugten Editor zu verwenden. Wenn du Dateien speicherst, aktualisiert die CLI das Remote-Theme oder die Komponente, und die Änderungen werden live angezeigt!

Installation

Um es auszuprobieren, stelle sicher, dass Ruby 2.5 oder höher installiert ist.

Wenn du Windows verwendest, hast du 2 Optionen:

Option 1: Windows Subsystem for Linux.

Windows 10 bietet Zugriff auf eine vollständige Linux-Umgebung. Du kannst sie nutzen, um Ruby einfach mit sudo apt-get install ruby zu installieren; dabei wird Ruby 2.3 installiert.

Option 2: Ältere Windows-Versionen

Ältere Windows-Versionen haben keinen Zugriff auf WSL. Du kannst Ruby problemlos mit dem Ruby Installer installieren. Wähle die empfohlene Version und die Standardeinstellungen für die Installation.

Mac OS Version 10.13.3 wird mit Ruby 2.3 ausgeliefert, es ist nichts Besonderes erforderlich. Wenn du eine frühere Version von Mac OS verwendest, erwäge die Verwendung von rvm, rbenv oder homebrew, um eine aktuelle Ruby-Version zu installieren.


Sobald Ruby 2.2 oder höher ausgeführt wird, öffne ein Terminal oder eine Befehlsschale und führe Folgendes aus:

gem install discourse_theme

Nach der Installation kannst du Folgendes ausführen, um mehr darüber zu erfahren:

discourse_theme

Aktualisierung

gem update discourse_theme

Funktionen

Die CLI bietet 3 Hauptfunktionen:

discourse_theme new

Du kannst sie verwenden, um schnell ein neues Theme mit discourse_theme new YOUR_DIR_NAME zu erstellen.

discourse_theme watch

Du kannst sie verwenden, um ein Theme zu überwachen und mit einer Discourse-Website synchron zu halten (mit Live-Refresh) unter Verwendung von discourse_theme watch YOUR_DIR_NAME.

Das bedeutet, dass du deinen eigenen Editor verwenden kannst, um dein Theme zu bearbeiten, und die Website wird magisch :unicorn: mit den Änderungen aktualisiert!

discourse_theme download

Du kannst ein bestehendes Theme von Discourse mit discourse_theme download YOUR_DIR_NAME herunterladen. Danach hast du die Möglichkeit, sofort mit dem “Watchen” zu beginnen!

Zugangsdaten

Du musst einen API-Key generieren. Gehe zum Admin-Bereich und generiere dort einen Key.

  • :exclamation: Wähle beim Generieren des Keys eine „User Level“ von Single User, nicht All Users.
  • :exclamation: Stelle sicher, dass du Global Key anhäkst, sonst erhältst du 403 Forbidden-Fehler.

Zugangsdaten werden (optional) unter ~/.discourse_theme gespeichert. API-Keys werden pro Website gespeichert, und die URL/theme_id für jedes Verzeichnis wird ebenfalls erfasst. Falls du deine Einstellungen jemals ändern musst, füge einfach --reset zu einem beliebigen Befehl hinzu, und du wirst erneut nach allen Werten gefragt.

Empfehlungen

„Dieses Tool ist wahrhaftig ein GEM!“ @awole20
„Das ist sehr, sehr gut.“ @awesomerobot
„Es funktioniert :slight_smile: Und es ist ziemlich dosh garn cool. Toll!“ @angus
„OMG. Es ist unglaublich.“ @pfaffman


Dieses Dokument wird versioniert verwaltet – schlage Änderungen auf github vor.

79 „Gefällt mir“
Theme Creator, create and show themes without installing Discourse!
CSS Theme Contest (with Prizes!)
Customizing handlebars templates
Setting up a solid workflow for custom theme development
Theme Developer Quick Reference Guide
Structure of themes and theme components
Automating Discourse Plugin Setup with `create-discourse-plugin` gem
Developing Plugins Faster by separating the frontend into a theme component
Feedback on "on-discourse" javascript for setting up custom JS for each page?
Add settings to your Discourse theme
Get started with Theme Creator and the Theme CLI
Designer's Guide to getting started with themes in Discourse
Split up theme Javascript into multiple files
Updated Custom Header Icon: Post Data via URL
Theme Developer Tutorial: 2. Creating a remote theme
Developing Discourse Themes & Theme Components
Hiding GUI elements for new users (less overwhelming)
Add custom content that only appears on your homepage
Custom CSS/HTML
If you want to edit this theme, you must submit a change on its repository
Edit CSS/HTML editor cursor offset makes it unusable due to CSS font override
How "difficult" is modifying/extending Discourse for a backend dev
Exporting a Theme from Staging and Importing it to the Production portal
Using Plugin Outlet Connectors from a Theme or Plugin
Downloaded component installs fine, but does not once changed/re-zipped
What are the benefits of a dev environment?
3.2.0.beta2-dev (7019dbcfe1) does not load CSS from common.scss anymore
End-to-end system testing for themes and theme components
Different CSS changes for different color schemes
Need help integrating code wrote on Edittext to the Discourse
Need help integrating code wrote on Edittext to the Discourse
Remote themes not in database
How to easily edit my site remotely?
When to use a plugin vs theme component?
Discourse core is switching to pnpm for JS package management
Using the new custom-homepage feature
Focus the editor when title is pre-filled
Cannot put the template in the desired outlet
Is this the correct way to create a theme component?
Split up theme Javascript into multiple files
Canvas Theme Template
Getting error while uploading theme
[Zotero extension +] Firefox v116 on macOS broken Discourse?
Install Discourse for development using Docker
How to install plugins without using a third-party host?
How to add a custom button in user profile card?
Import site theme via console
How are theme setting fields created?
Customisability in discourse?
Discourse Theme CLI is the bomb
Discourse 2.0.0.beta5 Release Notes
How difficult would it be to make the Discourse UI more like Flarum?
Discourse-webpack: A boilerplate for developing JS-heavy Discourse components
Import Error: about.json does not exist, or is invalid
How to Add Unique HTML Content Below Topic Body in discourse forum for Specific Topics
Reuse Discourse Hamburger Functionality
Themes - Add a description field
Create and share a font theme component
Customisability in discourse?
How to create a theme (if I am a pure end user)
Linting configuration
Linting configuration
Is it possible to use a local plugin directory with a docker install?
How to overrule a color variable for one theme only?
Can't customize text on custom button in template override using UI
Is it possible to use theme component from local folder (as plugin) - for local development?
Restrict editing of remote themes
When exporting a theme, I get a broken archive