Compare commits

..

No commits in common. "70d035c41016078582f1c9f0bcc809a8d13adb28" and "7abb70b8793bbac212882efcd50ac45565932ae1" have entirely different histories.

2 changed files with 2 additions and 11 deletions

View file

@ -117,7 +117,6 @@ you MAY set these variables:
- `TAGS` (as an array!)
- `DONT_CACHE` (to explicitly not cache the rendered blag)
- `WRITTEN_AT` (if the filesystem/libc doesn't support it)
- `RAW` (see [raw responses](#raw_responses))
you SHOULD NOT set `MODIFIED_AT` unless you have a valid reason.
@ -130,13 +129,6 @@ safely use `jq` to parse it.
the rest is normal
### raw responses
if you set `RAW` to a non-empty value, bingus-blog will abort normal
function and instead respond with whatever your script outputted, setting
the Content-Type header to the value of `RAW`. this can be used to implement
APIs in blag (do not do this).
### cache invalidation
due to how blag works, the hash of the query params is stored alongside the

5
blag
View file

@ -34,13 +34,12 @@ metadata() {
local tags=$(for tag in "${TAGS[@]}"; do printf '%s' "$tag" | jq -Rs .; done | jq -sr @json)
local dont_cache=false
[[ "${DONT_CACHE:+x}" == 'x' ]] && dont_cache=true
local raw=$(_json_str_opt "$RAW")
printf '{"title":%s,"description":%s,"author":%s,"icon":%s,"icon_alt":%s,"color":%s,"created_at":%s,"modified_at":%s,"tags":%s,"dont_cache":%s,"raw":%s}\n' \
printf '{"title":%s,"description":%s,"author":%s,"icon":%s,"icon_alt":%s,"color":%s,"created_at":%s,"modified_at":%s,"tags":%s,"dont_cache":%s}\n' \
"$title" "$description" "$author" \
"$icon" "$icon_alt" "$color" \
"$created_at" "$modified_at" \
"$tags" "$dont_cache" "$raw"
"$tags" "$dont_cache"
}