This commit is contained in:
Ivy Turner 2025-05-05 15:55:53 +01:00
parent 5f63527955
commit f51dc7e078
No known key found for this signature in database
31 changed files with 331 additions and 88 deletions

25
trellis.sh Executable file
View file

@ -0,0 +1,25 @@
#!/usr/bin/env bash
caddy_config="./src/data/caddy.json"
gen_redirects () {
caddyfile="redirects.caddyfile"
# clean before we append
rm -rf $caddyfile;
touch $caddyfile;
# Append the redirects
jq -r '.redirects | to_entries[] | "redir \(.key) \(.value)"' "$caddy_config" >> "$caddyfile";
}
gen_robots () {
caddyfile="robots.caddyfile"
rm -rf $caddyfile;
touch $caddyfile;
jq -r '.blockedCrawlers | to_entries | "respond \(.value) "Access Denied" 403';
}
gen_robots
gen_redirects