تثبيت تطبيق وحدة التحكم Discourse Theme CLI لمساعدتك في بناء الثيمات

إن discourse Discourse Theme CLI هو جوهرة روبي (ruby gem) تسمح لك باستخدام المحرر الذي تختاره عند تطوير سمات أو مكونات سمات Discourse. عند حفظ الملفات، سيقوم الـ CLI بتحديث السمة أو المكون البعيد وستظهر التغييرات التي تطرأ عليها مباشرة!

التثبيت

للتجربة، تأكد من تثبيت Ruby 2.5 أو إصدار أحدث.

إذا كنت تستخدم نظام ويندوز (Windows)، لديك خياران:

الخيار 1: نظام ويندوز الفرعي لنظام لينكس.

يحتوي ويندوز 10 على إمكانية الوصول إلى بيئة لينكس كاملة، يمكنك استخدامها لتثبيت روبي ببساطة عبر sudo apt-get install ruby، وهذا سيعطيك Ruby 2.3.

الخيار 2: ويندوز الأقدم

الإصدارات الأقدم من ويندوز ليس لديها وصول إلى WSL، يمكنك تثبيت روبي بسهولة باستخدام Ruby Installer، اختر الإصدار الموصى به والإعدادات الافتراضية للتثبيت.

يأتي نظام التشغيل ماك أو إس (Mac OS) الإصدار 10.13.3 مع Ruby 2.3 بشكل افتراضي، لا حاجة لشيء مميز. إذا كنت تستخدم إصدارًا أقدم من Mac OS، ففكر في استخدام rvm أو rbenv أو homebrew لتثبيت إصدار حديث من روبي.


بمجرد تشغيل Ruby 2.2 أو أحدث، افتح طرفية (terminal) أو موجه أوامر (command shell) وقم بتشغيل:

gem install discourse_theme

بعد التثبيت، لمعرفة المزيد عنه:

discourse_theme

التحديث

gem update discourse_theme

الميزات

يوفر الـ CLI ثلاث وظائف رئيسية:

discourse_theme new

يمكنك استخدامه لإنشاء سمة جديدة بسرعة باستخدام discourse_theme new YOUR_DIR_NAME

discourse_theme watch

يمكنك استخدامه لمراقبة سمة ومزامنتها مع موقع discourse (مع تحديث مباشر) باستخدام discourse_theme watch YOUR_DIR_NAME

هذا يعني أنه يمكنك استخدام المحرر الخاص بك لتعديل السمة الخاصة بك وسيقوم الموقع بتحديث :unicorn: التغييرات بشكل سحري!

discourse_theme download

يمكنك تنزيل سمة موجودة من Discourse باستخدام discourse_theme download YOUR_DIR_NAME. سيُعرض عليك بعد ذلك خيار بدء “المراقبة” على الفور!

بيانات الاعتماد

ستحتاج إلى إنشاء مفتاح API. اذهب إلى منطقة المسؤول (admin area) وقم بإنشاء مفتاح هناك.

  • :exclamation: اختر مستوى “مستخدم واحد” (Single User) عند إنشاء المفتاح، وليس “جميع المستخدمين” (All Users).
  • :exclamation: تأكد من تحديد “مفتاح عام” (Global Key) وإلا ستتلقى أخطاء 403 Forbidden.

يتم تخزين بيانات الاعتماد (اختياريًا) في ~/.discourse_theme. يتم تخزين مفاتيح API لكل موقع على حدة، ويتم أيضًا تتبع عنوان URL ومعرّف السمة (theme_id) لكل دليل. إذا احتجت في أي وقت إلى تغيير إعداداتك، فما عليك سوى إضافة --reset إلى أي أمر وسيُطلب منك جميع القيم مرة أخرى.

شهادات العملاء

“هذه الأداة هي جوهرة حقيقية!” @awole20
“هذا جيد جدًا جدًا.” @awesomerobot
“إنها تعمل :slight_smile: وهي رائعة جدًا. جميل!” @angus
“يا إلهي. إنه أمر لا يصدق.” @pfaffman


يتم التحكم في إصدار هذه الوثيقة - اقترح تغييرات على github.

79 إعجابًا
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