aaaaaa
This commit is contained in:
parent
5f63527955
commit
f51dc7e078
31 changed files with 331 additions and 88 deletions
25
trellis.sh
Executable file
25
trellis.sh
Executable 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
|
Loading…
Add table
Add a link
Reference in a new issue