mirror of
https://github.com/HandBrake/HandBrake-docs.git
synced 2026-07-02 14:31:36 -05:00
build: Exclude advanced nav from non-article documents.
This commit is contained in:
@@ -142,7 +142,7 @@ function build_source {
|
||||
# process includes
|
||||
NAVIGATION_PARTIAL="${DOCS_DIR}/$(string_filter \"${DOCUMENT_Language_Code:-.}\" slug)/$(string_filter \"${DOCUMENT_Project_Version:-.}\" slug)/${CONFIG_Navigation%.markdown}.partial.html"
|
||||
NAVIGATION_RELPATH="${BASE_RELPATH#../../}"
|
||||
if [[ -e "${NAVIGATION_PARTIAL}" ]]; then
|
||||
if [[ -e "${NAVIGATION_PARTIAL}" ]] && [[ "${DOCUMENT_Type}" == "article" ]]; then
|
||||
sed -E \
|
||||
-e 's|<h1>([^<]+)</h1>|<h1><a href="'"${NAVIGATION_RELPATH}${CONFIG_Navigation%.markdown}.html"'">\1</a></h1>|' \
|
||||
-e 's|(<a href=")([^.])|\1'"${NAVIGATION_RELPATH}"'\2|g' \
|
||||
|
||||
Reference in New Issue
Block a user