From 03f8642f77920fad8262f76f67f5b074a5363452 Mon Sep 17 00:00:00 2001 From: Adam Schmalhofer Date: Wed, 19 Jan 2022 18:25:39 +0100 Subject: [PATCH] Offer an easy way to only have a restricted apps --- apps.json | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/apps.json b/apps.json index 1455a2b13..4efd5318a 100644 --- a/apps.json +++ b/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 -%} ]