mirror of
https://github.com/HandBrake/HandBrake-docs.git
synced 2025-12-11 04:35:53 -06:00
build: Add support for content template.
This commit is contained in:
parent
eb9c19edc4
commit
7e91bfdf44
13
build-docs
13
build-docs
@ -173,17 +173,21 @@ function build_source {
|
||||
# partial html
|
||||
cp "${TEMPLATE_Document}" "${DEST}.html"
|
||||
fi
|
||||
# inject document
|
||||
# inject document template
|
||||
sed -E \
|
||||
-e '/\{\{[ ]*template\.document[ ]*\}\}/{r '"${TEMPLATE_Document:-}" -e 'd;}' \
|
||||
-i.sedbak "${DEST}.html"
|
||||
# inject header, content, footer
|
||||
# inject header, content, footer templates
|
||||
sed -E \
|
||||
-e '/\{\{[ ]*template\.header[ ]*\}\}/{r '"${TEMPLATE_Header:-}" -e 'd;}' \
|
||||
-e '/\{\{[ ]*document\.content[ ]*\}\}/{r '"${DOCUMENT_Content:-}" -e 'd;}' \
|
||||
-e '/\{\{[ ]*template\.content[ ]*\}\}/{r '"${TEMPLATE_Content:-}" -e 'd;}' \
|
||||
-e '/\{\{[ ]*template\.footer[ ]*\}\}/{r '"${TEMPLATE_Footer:-}" -e 'd;}' \
|
||||
-i.sedbak "${DEST}.html"
|
||||
# inject nav
|
||||
# inject content
|
||||
sed -E \
|
||||
-e '/\{\{[ ]*document\.content[ ]*\}\}/{r '"${DOCUMENT_Content:-}" -e 'd;}' \
|
||||
-i.sedbak "${DEST}.html"
|
||||
# inject nav template
|
||||
sed -E \
|
||||
-e '/\{\{[ ]*template\.nav[ ]*\}\}/{r '"${TEMPLATE_Nav:-}" -e 'd;}' \
|
||||
-i.sedbak "${DEST}.html"
|
||||
@ -300,6 +304,7 @@ if [[ -e "${TEMPLATE_CONFIG}" ]]; then
|
||||
TEMPLATE_Header="${TEMPLATE_DIR}/${TEMPLATE_Header}"
|
||||
TEMPLATE_Nav="${TEMPLATE_DIR}/${TEMPLATE_Nav}"
|
||||
TEMPLATE_Document="${TEMPLATE_DIR}/${TEMPLATE_Document}"
|
||||
TEMPLATE_Content="${TEMPLATE_DIR}/${TEMPLATE_Content}"
|
||||
TEMPLATE_Footer="${TEMPLATE_DIR}/${TEMPLATE_Footer}"
|
||||
TEMPLATE_Redirect="${TEMPLATE_DIR}/${TEMPLATE_Redirect}"
|
||||
TEMPLATE_Assets_Fonts=()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user