Installa l'app console Discourse Theme CLI per aiutarti a creare temi

Il discourse Discourse Theme CLI è una gemma ruby che ti permette di usare l’editor che preferisci quando sviluppi temi o componenti tema di Discourse. Quando salvi i file, la CLI aggiornerà il tema o componente remoto e le modifiche appariranno in tempo reale!

Installazione

Per provarlo, assicurati di avere installato Ruby 2.5 o superiore.

Se usi Windows, hai 2 opzioni:

Opzione 1: Windows Subsystem for Linux.

Windows 10 ha accesso a un ambiente Linux completo, puoi usarlo per installare ruby semplicemente con sudo apt-get install ruby, questo ti darà Ruby 2.3.

Opzione 2: Windows più vecchio

Le versioni più vecchie di Windows non hanno accesso a WSL, puoi installare facilmente Ruby con Ruby Installer, scegli la versione consigliata e le impostazioni predefinite per l’installazione.

Mac OS versione 10.13.3 viene fornito con Ruby 2.3 di serie, non è necessario nulla di speciale. Se stai usando una versione precedente di Mac OS considera l’uso di rvm, rbenv o homebrew per installare una versione recente di ruby.


Una volta che Ruby 2.2 o successivo è in esecuzione, apri un terminale o un prompt dei comandi ed esegui:

gem install discourse_theme

Una volta installato, per saperne di più:

discourse_theme

Aggiornamento

gem update discourse_theme

Funzionalità

La CLI fornisce 3 funzioni principali:

discourse_theme new

Puoi usarla per creare rapidamente un nuovo tema con discourse_theme new NOME_TUA_DIRECTORY

discourse_theme watch

Puoi usarla per monitorare un tema e sincronizzarlo con un sito discourse (con aggiornamento in tempo reale) usando discourse_theme watch NOME_TUA_DIRECTORY

Ciò significa che puoi usare il tuo editor per modificare il tuo tema e il sito si aggiornerà magicamente :unicorn: con le modifiche!

discourse_theme download

Puoi scaricare un tema esistente da Discourse usando discourse_theme download NOME_TUA_DIRECTORY. Ti verrà quindi data l’opzione di iniziare a “monitorare” subito!

Credenziali

Dovrai generare una Chiave API. Vai all’area admin e genera una chiave lì.

  • :exclamation: Seleziona un “Livello Utente” di Utente Singolo quando generi la chiave, non Tutti gli Utenti.
  • :exclamation: Assicurati di spuntare Chiave Globale o riceverai errori 403 forbidden.

Le credenziali sono (facoltativamente) memorizzate in ~/.discourse_theme. Le chiavi API sono memorizzate per sito, e anche l’URL/theme_id per ogni directory viene tracciato. Se hai mai bisogno di cambiare le tue impostazioni, aggiungi semplicemente --reset a qualsiasi comando e ti verranno richieste nuovamente tutte le impostazioni.

Testimonianze

“Questo strumento è veramente una GEMMA!” @awole20
“Questo è molto molto buono.” @awesomerobot
“Funziona :slight_smile: Ed è piuttosto dannatamente bello. Ottimo!” @angus
“OMG. È incredibile.” @pfaffman


Questo documento è controllato in versione - suggerisci modifiche su github.

79 Mi Piace
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
When exporting a theme, I get a broken archive
Install Discourse for development using Docker
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
[Zotero extension +] Firefox v116 on macOS broken Discourse?
Remote themes not in database
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
How to add a custom button in user profile card?
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
If you want to edit this theme, you must submit a change on its repository
Import site theme via console
How are theme setting fields created?
Customisability in discourse?
Edit CSS/HTML editor cursor offset makes it unusable due to CSS font override
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