ثبّت تطبيق سطر الأوامر الخاص بواجهة Discourse Theme CLI لمساعدتك في بناء القوالب

The discourse Discourse Theme CLI هو جوهرة ruby تتيح لك استخدام المحرر الذي تفضله عند تطوير قوالب Discourse ومكونات القوالب. عند حفظ الملفات، ستقوم أداة CLI بتحديث القالب أو المكون عن بُعد، وستظهر التغييرات مباشرةً!

التثبيت

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

إذا كنت تستخدم Windows، فلك خياران:

الخيار 1: Windows Subsystem for Linux.

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

الخيار 2: إصدارات Windows الأقدم

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

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


بمجرد تشغيل Ruby 2.2 أو أحدث، افتح طرفية أو 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. انتقل إلى منطقة الإدارة وولّد المفتاح هناك.

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

تُخزَّن بيانات الاعتماد (اختيارياً) في ~/.discourse_theme. تُخزَّن مفاتيح API لكل موقع، ويتم أيضاً تتبع عنوان URL/معرف القالب لكل مجلد. إذا احتجت إلى تغيير إعداداتك في أي وقت، ما عليك سوى إضافة --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
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