summaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@gmail.com>2021-03-10 23:28:39 +0100
committerKévin Le Gouguec <kevin.legouguec@gmail.com>2021-03-10 23:28:39 +0100
commitd148eeb4a46cb647d13d451cb01cdc66835d2b03 (patch)
tree7d25301eee1714e71570225abee033a5ec81cc0d /build.sh
parent9f74233ffedb0609d43d54b6169dc47dd6337803 (diff)
downloadquatuorbellefeuille.com-d148eeb4a46cb647d13d451cb01cdc66835d2b03.tar.xz
Add links from/to English pages
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/build.sh b/build.sh
index a9035f3..583bda0 100755
--- a/build.sh
+++ b/build.sh
@@ -32,13 +32,20 @@ sed -i s/'{TITLE}'/"${title}"/ ${output}
link_stylesheets=''
for s in "${stylesheets[@]}"
do
- spath=$(realpath --relative-to $(dirname "${input}") stylesheets/"${s}".css)
+ # Prefer relative paths so that drafts under /admin/drafts find
+ # the correct stylesheets.
+ # ${input} might be a temporary file; assume ${template} is a
+ # bona-fide node in our directory hierarchy, and use that to
+ # compute the path to the stylesheets folder.
+ spath=$(realpath --relative-to $(dirname "${template}") stylesheets/"${s}".css)
link_template='<link rel="stylesheet" href="%s">\n'
link_stylesheets+=$(printf "${link_template}" "${spath}")
done
sed -i /'{STYLESHEETS}'/'c\'"${link_stylesheets}" ${output}
+sed -i s/'{TRANSLATION}'/"${translation}"/ ${output}
+
for transform in "${transforms[@]}"
do
sed -i "${transform}" ${output}