Small fix to build script

This commit is contained in:
pietervdvn 2021-12-23 14:37:17 +01:00
parent a3c6ac05df
commit c8ba8a2c36

View file

@ -1,5 +1,5 @@
#! /bin/bash #! /bin/bash
: '
echo "Starting build.Should" echo "Starting build.Should"
# The build script; we build the application step by step as building everything at once takes too much RAM # The build script; we build the application step by step as building everything at once takes too much RAM
# Should be run from the repository root # Should be run from the repository root
@ -32,3 +32,12 @@ do
# npm run generate && node --max_old_space_size=12000 $(which parcel) build # npm run generate && node --max_old_space_size=12000 $(which parcel) build
parcel build --public-url './' --no-source-maps "$theme.html" parcel build --public-url './' --no-source-maps "$theme.html"
done done
'
# At last: a workaround; parcel 1.x borks the link to social images; the public-URL (./) is setup incorrectly, so we fix those
cd dist
echo -e "Fixing social images..."
for file in $(ls *.html)
do
sed -i 's!<meta content="\([^"]\+\)" property="og:image">!<meta content="./\1" property="og:image">!' $file
sed -i 's!<meta property="og:image" content="\([^"]\+\)">!<meta content="./\1" property="og:image">!' $file
done