@cryptotaxi247 / netdata-1 / commits / dc218369c

Fixed broken left navbar links in translated site (#6505)

Chris Akritidis committed Jul 22, 2019 at 16:46 UTC dc218369c67da0654153b375df9d3089045ba889
1 file changed +4 -8
docs/generator/buildhtml.sh
+4 -8
@@ -24,11 +24,6 @@ echo "Copying files"
24 rm -rf ${SRC_DIR}
25 find . -type d \( -path ./${GENERATOR_DIR} -o -path ./node_modules \) -prune -o -name "*.md" -print | cpio -pd ${SRC_DIR}
26
27 -# Move main README.md file to what-is-netdata.md
28 -# echo "Replacing docs homepage"
29 -# mv ./${SRC_DIR}/README.md ./${SRC_DIR}/what-is-netdata.md
30 -# mv ./${SRC_DIR}/DOCUMENTATION.md ./${SRC_DIR}/README.md
31 -
27 # Copy Netdata html resources
28 cp -a ./${GENERATOR_DIR}/custom ./${SRC_DIR}/
29
@@ -64,7 +59,7 @@ prep_html() {
59 lang="${1}"
60 echo "Creating ${lang} mkdocs.yaml"
61
67 - if [ "${lang}" = "en" ] ; then
62 + if [ "${lang}" == "en" ] ; then
63 SITE_DIR="build"
64 else
65 SITE_DIR="build/${lang}"
@@ -89,9 +84,10 @@ prep_html() {
84 find "${GENERATOR_DIR}/${SITE_DIR}" -name "*.html" -print0 | xargs -0 sed -i -e 's/https:\/\/github.com\/netdata\/netdata\/blob\/master\/\S*md/https:\/\/github.com\/netdata\/localization\//g'
85 fi
86
92 - # Replace index.html with DOCUMENTATION/index.html
87 + # Replace index.html with DOCUMENTATION/index.html. Since we're moving it up one directory, we need to remove ../ from the links
88 echo "Replacing index.html with DOCUMENTATION/index.html"
94 - cat ${GENERATOR_DIR}/${SITE_DIR}/DOCUMENTATION/index.html > ${GENERATOR_DIR}/${SITE_DIR}/index.html
89 + sed 's/\.\.\///g' ${GENERATOR_DIR}/${SITE_DIR}/DOCUMENTATION/index.html > ${GENERATOR_DIR}/${SITE_DIR}/index.html
90 +
91 }
92
93 for d in "en" $(find ${LOC_DIR} -mindepth 1 -maxdepth 1 -name .git -prune -o -type d -printf '%f ') ; do