From 8609fca9258c73bb2802140dad320b5b269d3fb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Tue, 4 May 2021 11:52:59 +0200 Subject: [PATCH] Create domains.json (#2536) --- netlify.toml | 5 +++++ scripts/build.sh | 3 +++ 2 files changed, 8 insertions(+) diff --git a/netlify.toml b/netlify.toml index 01a45edd..2e51a6a9 100644 --- a/netlify.toml +++ b/netlify.toml @@ -12,6 +12,11 @@ [headers.values] Cache-Control = "public, max-age: 900, s-maxage=604800, must-revalidate" +[[headers]] + for = "/domains.json" + [headers.values] + Cache-Control = "public, max-age: 900, s-maxage=604800, must-revalidate" + [[redirects]] from = "/" to = "https://github.com/home-assistant/brands" diff --git a/scripts/build.sh b/scripts/build.sh index 717c8121..d6c93015 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -37,3 +37,6 @@ find ./build -type f -name "logo.png" | while read logo; do echo "Using ${logo} as hDPI logo" fi done + +# Create domains.json +find ./build -maxdepth 1 -type d -exec basename {} \; | sort | jq -sR 'split("\n")[1:]' | jq 'map(select(length > 0))' > ./build/domains.json