mirror of
https://github.com/HandBrake/HandBrake-docs.git
synced 2025-12-11 23:39:12 -06:00
build: Substitute empty string for empty/unset template variables.
This commit is contained in:
parent
5feb27c251
commit
c3b0fd142a
14
build-docs
14
build-docs
@ -103,9 +103,9 @@ function build_source {
|
||||
cp "${TEMPLATE_Base}" "${DEST}.html"
|
||||
# inject meta, title, styles, document, scripts
|
||||
sed -E \
|
||||
-e '/\{\{[ ]*template\.meta[ ]*\}\}/{r '"${TEMPLATE_Meta}" -e 'd;}' \
|
||||
-e '/\{\{[ ]*template\.title[ ]*\}\}/{r '"${TEMPLATE_Title}" -e 'd;}' \
|
||||
-e '/\{\{[ ]*template\.document[ ]*\}\}/{r '"${TEMPLATE_Document}" -e 'd;}' \
|
||||
-e '/\{\{[ ]*template\.meta[ ]*\}\}/{r '"${TEMPLATE_Meta:-}" -e 'd;}' \
|
||||
-e '/\{\{[ ]*template\.title[ ]*\}\}/{r '"${TEMPLATE_Title:-}" -e 'd;}' \
|
||||
-e '/\{\{[ ]*template\.document[ ]*\}\}/{r '"${TEMPLATE_Document:-}" -e 'd;}' \
|
||||
-i.sedbak "${DEST}.html"
|
||||
fi
|
||||
else
|
||||
@ -122,10 +122,10 @@ function build_source {
|
||||
fi
|
||||
# inject header, content, footer
|
||||
sed -E \
|
||||
-e '/\{\{[ ]*template\.header[ ]*\}\}/{r '"${TEMPLATE_Header}" -e 'd;}' \
|
||||
-e '/\{\{[ ]*document\.content[ ]*\}\}/{r '"${DOCUMENT_Content}" -e 'd;}' \
|
||||
-e '/\{\{[ ]*template\.footer[ ]*\}\}/{r '"${TEMPLATE_Footer}" -e 'd;}' \
|
||||
-e '/\{\{[ ]*template\.nav[ ]*\}\}/{r '"${TEMPLATE_Nav}" -e 'd;}' \
|
||||
-e '/\{\{[ ]*template\.header[ ]*\}\}/{r '"${TEMPLATE_Header:-}" -e 'd;}' \
|
||||
-e '/\{\{[ ]*document\.content[ ]*\}\}/{r '"${DOCUMENT_Content:-}" -e 'd;}' \
|
||||
-e '/\{\{[ ]*template\.footer[ ]*\}\}/{r '"${TEMPLATE_Footer:-}" -e 'd;}' \
|
||||
-e '/\{\{[ ]*template\.nav[ ]*\}\}/{r '"${TEMPLATE_Nav:-}" -e 'd;}' \
|
||||
-i.sedbak "${DEST}.html"
|
||||
# process template tags
|
||||
TEMPLATE_Scripts=""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user