إضافة تبعيات السمة في المواصفات

As a Discourse theme author, I want to be able to specify child/component themes that are required for my theme to work correctly, so the user (Discourse site admin) doesn’t have to manually go out and add/configure it.

We are working on a downstream theme to work alongside the Mozilla theme (thanks @LeoMcA!) but it’d be nice if we didn’t have to manually specify import their theme and manually link them. Could such a relationship be added to the about.json file?

11 إعجابًا

An aside, this would also benefit developers who build themes for clients. It’s becoming a more appealing setup to use a public theme and then tweak it for the client site. But more and more often, they want their customized theme in GitHub for pulling updates and allowing multiple people to work on them. It’d be great to embed the dependency somehow.

11 إعجابًا

Asking for advanced features like this makes me :blush:, means the system is being used

Not against building this but needs very careful testing

6 إعجابات

I imagine it’d also be useful for you to be able to specify a particular version/commit that the theme depends on - that way, if we completely change something you’re depending on, it won’t all suddenly break on your end.

4 إعجابات

Yes, good point … although makes it a bit more complex. :slight_smile:

Maybe. If you can add the dependency as a GitHub link of sorts that allows a specific commit, branch, or tag, it gets easier. But that doesn’t mean the whole feature is easy.

5 إعجابات

Or any non-GH Git repository :wink:

إعجاب واحد (1)

@vinothkannans أضاف للتو دعمًا للإدراج الأولي لمكونات السمات المعتمدة، مما يجعل تثبيت الحزمة أسهل بكثير.

سينشر هنا المزيد من التفاصيل!

إعجاب واحد (1)

الآن يمكن تحديد قائمة بمكونات السمات الفرعية في ملف about.json للسمات الرئيسية. على سبيل المثال

{
  "name": "Material Design Theme",
  "about_url": "https://meta.discourse.org/t/material-design-stock-theme/47142",
  "license_url": "https://github.com/discourse/material-design-stock-theme/blob/master/LICENSE.txt",
  "components": ["https://github.com/discourse/discourse-brand-header", "https://github.com/Chaboi45/Take-a-break-component"]
  .
  .
  .
}

حاليًا، توجد القيود التالية

  1. سيتم تثبيت جميع مكونات السمات الفرعية فقط أثناء التثبيت الأولي.
  2. إذا تم إزالة المكونات لاحقًا من ملف about.json، فلن يتم إزالة مكون السمة الفرعية المثبت.
  3. إذا تم إزالة مكون سمة مثبت يدويًا، فلن يقوم النظام بتثبيته مرة أخرى.
  4. لا يمكنك تحديد مكونات سمات فرعية لسمة أخرى.
5 إعجابات

أتساءل عما إذا كان من الممكن النظر في إمكانية تعيين الإعدادات الافتراضية لمكونات السمات المرفقة.

على سبيل المثال، تغيير القيم الافتراضية في settings.yml الخاص بـ https://meta.discourse.org/t/discourse-button-styles/88154، لتصبح قيمًا محددة تتوافق مع سمة على المستوى الأعلى.

(حاليًا، أعتقد أنك ستضطر إلى عمل نسخة فرعية من مكون السمة).