build: Exclude advanced nav from non-article documents.

This commit is contained in:
Bradley Sepos
2016-05-20 19:43:16 -04:00
parent 1a2958087c
commit 1a3d9ed5cc

View File

@@ -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' \