Skip to content

[Shock] - Let users load themes from a git repository #213

@matthew-carroll

Description

@matthew-carroll

A theme is a directory of data, pages, assets, layouts, and components. Let users load a theme by specifying a git repository. Use the same syntax as pubspec.yaml to work with what developers know.

In main.dart:

StaticShock(
  themes: [
    Theme.fromGit(
      url: ...,
      path: ...,
      ref: ...,
    ),
  ],
);

Update
Previously I said we should be able to configure themes from _data.yaml. I've changed my mind on that, at least for now. Themes, themselves, can contribute data. To implement support in _data.yaml, we'd need to load all local data first, to determine what themes we want, then load the themes, then load local data again in the regular data loading step. This is because themes need to be loaded before doing anything else, including picking files or loading data.

To reduce excess processing, and reduce implementation complexity, I'm removing _data.yaml support from the desired behavior. Users must list themes in their Dart configuration.

In root _data.yaml:

theme:
  git:
    url: ...
    path: ...
    ref: ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions