Aggiungi le dipendenze del tema nella specifica

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 Mi Piace

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 Mi Piace

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 Mi Piace

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 Mi Piace

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 Mi Piace

Or any non-GH Git repository :wink:

1 Mi Piace

@vinothkannans ha appena aggiunto il supporto per l’elenco iniziale dei componenti del tema dipendenti, in modo che l’installazione di un bundle sia molto più semplice.

Pubblicherà qui ulteriori dettagli!

1 Mi Piace

Ora è possibile specificare un elenco di componenti del tema figlio nel file about.json per i temi di primo livello. Ad esempio

{
  "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"]
  .
  .
  .
}

Attualmente, presenta le seguenti limitazioni:

  1. Tutti i componenti del tema figlio verranno installati solo durante l’installazione iniziale.
  2. Se i componenti vengono rimossi successivamente da about.json, il componente del tema figlio installato non verrà rimosso.
  3. Se un componente del tema installato viene rimosso manualmente, il sistema non lo installerà nuovamente.
  4. Non è possibile specificare componenti del tema figlio per un altro componente del tema.
5 Mi Piace

Mi chiedo se possa essere presa in considerazione la possibilità di impostare le impostazioni predefinite per i componenti dei temi inclusi.

Ad esempio, modificare i valori predefiniti in settings.yml di Discourse Button Styles, per adattarli a valori specifici che corrispondano a un tema di livello superiore.

(Attualmente, credo che si dovrebbe eseguire un fork del componente del tema)