wm-AllKids-tibi2023/scripts/preload-meta.sh
Grit-Grenzdoerfer 5f27fe0c5b Initial commit
2023-09-17 13:24:39 +02:00

17 lines
341 B
Bash
Executable File

#!/bin/bash
if [ "$1" == "" ]; then
echo template filename required
exit 1
fi
preload=$(for f in frontend/dist/*.woff2; do
echo "<link rel=\"preload\" href=\"/dist/`basename $f`\" as=\"font\" type=\"font/woff2\" crossorigin />"
done)
template="`cat $1 | sed -e 's#<!--PRELOAD-->#\$preload#'`"
eval "cat <<EOF
$template
EOF"