Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat community templates #68

Merged
merged 6 commits into from
Jan 19, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update README.md
  • Loading branch information
lowlighter committed Jan 19, 2021
commit b982f302ba4ddee776e539ef82f7dd0054bb4326
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,33 @@ The default template is `classic`.
* **N**: Feature is already released, but new ones are available on `@master`
* **R**: Repository template (all plugins content will be restricted to related repository)

<details>
<summary>💬 Using community templates</summary>

🚧 This feature is available as pre-release on @master branch (unstable)

It is possible to use official releases along with custom templates from forked repositories (not necessarily your own).
This can be used to use different layouts, styles colors, etc.

Use `setup_community_templates` option to specify additional external sources in the following format: `user/repo@branch:template`. Templates added this way will be downloaded through git and will be available with the same template name but prefixed with `@`.

For example, to use the `super-metrics` template from `github-user`'s fork, add the following:
```yaml
- uses: lowlighter/metrics@master
with:
# ... other options
template: "@super-metrics"
setup_community_templates: github-user/metrics@latest:classic
```

To create a community template, just fork this repository and create a new folder in `/source/templates` with the same structure as current templates.
Then, it's just as simple as HTML and CSS with a bit of JavaScript!

⚠️ Community templates are restricted to common and plugins data.
Their "template.mjs" is automatically removed to prevent malicious code injection.

</details>

<details>
<summary>💬 Using repository template</summary>

Expand Down