mirror of https://github.com/espruino/BangleApps
Offer an easy way to only have a restricted apps
parent
38170905ca
commit
03f8642f77
17
apps.json
17
apps.json
|
@ -1,4 +1,8 @@
|
|||
---
|
||||
# uncomment the following line if you only want explicitly listed
|
||||
# apps to be available on your site
|
||||
|
||||
# restricted: ["boot", "launch", "antonclk", "health", "setting", "about", "widbat", "widbt", "widlock", "widid"]
|
||||
---
|
||||
{% comment %}
|
||||
=================================================================
|
||||
|
@ -12,14 +16,21 @@
|
|||
|
||||
=================================================================
|
||||
{% endcomment %}
|
||||
{%- assign apps = site.static_files | where: "name", "metadata.json" -%}
|
||||
{%- if page.restricted == nil -%}
|
||||
{%- assign apps = site.static_files | where: "name", "metadata.json" | map: "path" -%}
|
||||
{%- else -%}
|
||||
{%- capture temp -%}
|
||||
{%- for app in page.restricted %} /apps/{{app}}/metadata.json {%- endfor -%}
|
||||
{%- endcapture -%}
|
||||
{%- assign apps = temp | strip | split: " " -%}
|
||||
{%- endif -%}
|
||||
|
||||
[
|
||||
|
||||
{%- include_relative {{ apps.first.path }} -%}
|
||||
{%- include_relative {{ apps.first }} -%}
|
||||
|
||||
{%- for app in apps offset:1 -%}
|
||||
,{%- include_relative {{ app.path }} -%}
|
||||
,{%- include_relative {{ app }} -%}
|
||||
{%- endfor -%}
|
||||
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue