mirror of
https://github.com/HandBrake/HandBrake-docs.git
synced 2025-12-13 03:01:59 -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"
|
cp "${TEMPLATE_Base}" "${DEST}.html"
|
||||||
# inject meta, title, styles, document, scripts
|
# inject meta, title, styles, document, scripts
|
||||||
sed -E \
|
sed -E \
|
||||||
-e '/\{\{[ ]*template\.meta[ ]*\}\}/{r '"${TEMPLATE_Meta}" -e 'd;}' \
|
-e '/\{\{[ ]*template\.meta[ ]*\}\}/{r '"${TEMPLATE_Meta:-}" -e 'd;}' \
|
||||||
-e '/\{\{[ ]*template\.title[ ]*\}\}/{r '"${TEMPLATE_Title}" -e 'd;}' \
|
-e '/\{\{[ ]*template\.title[ ]*\}\}/{r '"${TEMPLATE_Title:-}" -e 'd;}' \
|
||||||
-e '/\{\{[ ]*template\.document[ ]*\}\}/{r '"${TEMPLATE_Document}" -e 'd;}' \
|
-e '/\{\{[ ]*template\.document[ ]*\}\}/{r '"${TEMPLATE_Document:-}" -e 'd;}' \
|
||||||
-i.sedbak "${DEST}.html"
|
-i.sedbak "${DEST}.html"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
@ -122,10 +122,10 @@ function build_source {
|
|||||||
fi
|
fi
|
||||||
# inject header, content, footer
|
# inject header, content, footer
|
||||||
sed -E \
|
sed -E \
|
||||||
-e '/\{\{[ ]*template\.header[ ]*\}\}/{r '"${TEMPLATE_Header}" -e 'd;}' \
|
-e '/\{\{[ ]*template\.header[ ]*\}\}/{r '"${TEMPLATE_Header:-}" -e 'd;}' \
|
||||||
-e '/\{\{[ ]*document\.content[ ]*\}\}/{r '"${DOCUMENT_Content}" -e 'd;}' \
|
-e '/\{\{[ ]*document\.content[ ]*\}\}/{r '"${DOCUMENT_Content:-}" -e 'd;}' \
|
||||||
-e '/\{\{[ ]*template\.footer[ ]*\}\}/{r '"${TEMPLATE_Footer}" -e 'd;}' \
|
-e '/\{\{[ ]*template\.footer[ ]*\}\}/{r '"${TEMPLATE_Footer:-}" -e 'd;}' \
|
||||||
-e '/\{\{[ ]*template\.nav[ ]*\}\}/{r '"${TEMPLATE_Nav}" -e 'd;}' \
|
-e '/\{\{[ ]*template\.nav[ ]*\}\}/{r '"${TEMPLATE_Nav:-}" -e 'd;}' \
|
||||||
-i.sedbak "${DEST}.html"
|
-i.sedbak "${DEST}.html"
|
||||||
# process template tags
|
# process template tags
|
||||||
TEMPLATE_Scripts=""
|
TEMPLATE_Scripts=""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user