mirror of
https://github.com/foo-dogsquared/website.git
synced 2025-01-31 07:58:02 +00:00
23 lines
486 B
Plaintext
23 lines
486 B
Plaintext
|
#!/usr/bin/env bash
|
||
|
|
||
|
LIMIT=5
|
||
|
INPUT_TEMP="./assets/templates/openring-input.html"
|
||
|
OUTPUT="./layouts/partials/openring.html"
|
||
|
DATA="data/blogs.json"
|
||
|
|
||
|
# Checks whether it is locally compiled or not.
|
||
|
if [[ -a ./openring ]]; then
|
||
|
OPENRING="./openring/openring";
|
||
|
else
|
||
|
OPENRING="openring";
|
||
|
fi
|
||
|
|
||
|
for feed in $(jq ".[]" "$DATA" | shuf --head-count $LIMIT); do
|
||
|
OPENRING="$OPENRING -s $feed";
|
||
|
done
|
||
|
|
||
|
OPENRING="$OPENRING -n $LIMIT < $INPUT_TEMP > $OUTPUT"
|
||
|
|
||
|
echo "$OPENRING"
|
||
|
eval $OPENRING
|