fix: build script assets
This commit is contained in:
parent
6592b70aef
commit
eef1067e3b
2 changed files with 20 additions and 10 deletions
17
build.sh
17
build.sh
|
@ -31,18 +31,29 @@ for locale in "${locales[@]}"; do
|
||||||
# for each file other than index.html, put a proper link back to the main page
|
# for each file other than index.html, put a proper link back to the main page
|
||||||
find ./ -not -name "index.html" -name "*.html" -exec sed -E -i "s/\"(\.\.\/)?$locale\.html/\"\1index.html/g" {} \+
|
find ./ -not -name "index.html" -name "*.html" -exec sed -E -i "s/\"(\.\.\/)?$locale\.html/\"\1index.html/g" {} \+
|
||||||
|
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
done
|
||||||
|
|
||||||
# repair the links of the footer locale switcher
|
# repair the links of the footer locale switcher
|
||||||
# for each line with data-lang-switch="{locale}" replace the href with the link to /{locale}/path...
|
# for each line with data-lang-switch="{locale}" replace the href with the link to /{locale}/path...
|
||||||
# attempt to do with pipe failed, so I use a non optimal for loop
|
# attempt to do with pipe failed, so I use a non optimal for loop
|
||||||
# find ./ -name "*.html" -exec sh -c 'sed -E -i "s/data-lang-switch=\"([a-z]{2})\".+href\=\".*\"/href\=\"\/\1\/{}\"/g" {}' \;
|
# find ./ -name "*.html" -exec sh -c 'sed -E -i "s/data-lang-switch=\"([a-z]{2})\".+href\=\".*\"/href\=\"\/\1\/{}\"/g" {}' \;
|
||||||
for path in $(find ./ -name "*.html"); do
|
for path in $(find ./ -name "*.html"); do
|
||||||
pathM=`echo $path | cut -c 3-`
|
pathM=`echo $path | cut -c 6-`
|
||||||
sed -E -i "s%data-lang-switch=\"([a-z]{2})\".+href\=\".*\"%href\=\"/\1/$pathM\"%g" $path
|
sed -E -i "s%data-lang-switch=\"([a-z]{2})\".+href\=\".*\"%href\=\"/\1/$pathM\"%g" $path
|
||||||
done
|
done
|
||||||
|
|
||||||
cd ..
|
# remove assets
|
||||||
done
|
rm -r *.woff dist imgs
|
||||||
|
find ./ -name '*.orig' -delete
|
||||||
|
|
||||||
|
# change the path of all assets
|
||||||
|
find ./ -name "*.html" -exec sed -E -i "s%\"\.\./dist/%\"/dist/%g; s%\"dist/%\"/dist/%g; s%\"\.\./imgs/%\"/imgs/%g; s%\"imgs/%\"/imgs/%g" {} \+
|
||||||
|
|
||||||
|
|
||||||
|
cp -r ../public/* ./
|
||||||
|
rm index.php
|
||||||
|
|
||||||
kill $phpPID
|
kill $phpPID
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,7 @@
|
||||||
<meta property=og:type content="website">
|
<meta property=og:type content="website">
|
||||||
<meta property=og:title content="{{ block('title') }}{{ getLocalizedStr('page.title') }}">
|
<meta property=og:title content="{{ block('title') }}{{ getLocalizedStr('page.title') }}">
|
||||||
<meta property=og:description content="{% block description %}{% endblock %}">
|
<meta property=og:description content="{% block description %}{% endblock %}">
|
||||||
<meta property=og:image content="/img/lefuturiste.jpg">
|
<meta property=og:image content="/imgs/profile-300.jpg">
|
||||||
<meta property=og:url content="https://lefuturiste.fr/{{ current_url() }}">
|
|
||||||
<meta property=og:locale content="{{ getLocale() }}">
|
<meta property=og:locale content="{{ getLocale() }}">
|
||||||
|
|
||||||
<title>{% block title %}{% endblock %}{{ getLocalizedStr('page.title') }}</title>
|
<title>{% block title %}{% endblock %}{{ getLocalizedStr('page.title') }}</title>
|
||||||
|
|
Loading…
Reference in a new issue