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