forked from cms/tibi-svelte-starter
17 lines
341 B
Bash
17 lines
341 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
if [ "$1" == "" ]; then
|
||
|
echo template filename required
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
preload=$(for f in dist/_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"
|