Add theme dependencies in specification

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개의 좋아요

번들된 테마 컴포넌트의 기본 설정을 지정할 수 있도록 하는 것이 고려될 수 있을지 궁금합니다.

예를 들어, https://meta.discourse.org/t/discourse-button-styles/88154의 settings.yml에서 기본값을 상위 레벨 테마에 맞춰 특정 값으로 변경하는 것입니다.

(현재로는 테마 컴포넌트를 포크해야 하는 것으로 알고 있습니다.)