Instala la aplicación de consola Discourse Theme CLI para crear temas

La discourse Discourse Theme CLI es un gem de Ruby que te permite usar tu editor preferido al desarrollar temas y componentes de temas de Discourse. A medida que guardas los archivos, la CLI actualizará el tema o componente remoto y los cambios aparecerán en vivo.

Instalación

Para probarla, asegúrate de tener instalado Ruby 2.5 o una versión posterior.

Si estás en Windows, tienes 2 opciones:

Opción 1: Windows Subsystem for Linux.

Windows 10 tiene acceso a un entorno Linux completo, puedes usarlo para instalar ruby simplemente con sudo apt-get install ruby, esto te dará Ruby 2.3.

Opción 2: Windows anteriores

Las versiones anteriores de Windows no tienen acceso a WSL, puedes instalar Ruby fácilmente con Ruby Installer, elige la versión recomendada y la configuración predeterminada para la instalación.

Mac OS versión 10.13.3 viene con Ruby 2.3 de fábrica, no se necesita nada especial. Si estás ejecutando una versión anterior de Mac OS, considera usar rvm, rbenv o homebrew para instalar una versión reciente de ruby.


Una vez que Ruby 2.2 o posterior esté en ejecución, abre una terminal o shell de comandos y ejecuta:

gem install discourse_theme

Una vez instalado, para saber más sobre él:

discourse_theme

Actualización

gem update discourse_theme

Características

La CLI proporciona 3 funciones principales:

discourse_theme new

Puedes usarla para crear rápidamente un nuevo tema con discourse_theme new TU_NOMBRE_DE_DIRECTORIO

discourse_theme watch

Puedes usarla para monitorear un tema y sincronizarlo con un sitio de discourse (con actualización en vivo) usando discourse_theme watch TU_NOMBRE_DE_DIRECTORIO

Esto significa que puedes usar tu propio editor para editar tu tema y el sitio se actualizará mágicamente :unicorn: con los cambios.

discourse_theme download

Puedes descargar un tema existente de Discourse usando discourse_theme download TU_NOMBRE_DE_DIRECTORIO. Luego se te dará la opción de comenzar a “monitorear” de inmediato.

Credenciales

Necesitarás generar una clave de API. Ve al área de administración y genera una clave allí.

  • :exclamation: Selecciona un “Nivel de Usuario” de Single User (Usuario Único) al generar la clave, no All Users (Todos los Usuarios).
  • :exclamation: Asegúrate de marcar Global Key (Clave Global) o recibirás errores 403 prohibido.

Las credenciales se almacenan (opcionalmente) en ~/.discourse_theme. Las claves de API se almacenan por sitio, y la URL/theme_id para cada directorio también se rastrea. Si en algún momento necesitas cambiar tus ajustes, simplemente agrega --reset a cualquier comando y se te solicitará nuevamente todos los valores.

Testimonios

“¡Esta herramienta es realmente una GEMA!” @awole20
“Esto es muy, muy bueno.” @awesomerobot
“Está funcionando :slight_smile: Y es bastante genial. ¡Genial!” @angus
“OMG. Es increíble.” @pfaffman


Este documento está bajo control de versiones - sugiere cambios en github.

79 Me gusta
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