From fa29f0f19d4c907aaf79dad1c88a7cc6dcee2ea3 Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Wed, 21 Dec 2016 14:57:47 +0000 Subject: [PATCH] Fix the header-nav links option --- server-ce/settings.coffee | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/server-ce/settings.coffee b/server-ce/settings.coffee index 58f83c5def..a132c4eb99 100644 --- a/server-ce/settings.coffee +++ b/server-ce/settings.coffee @@ -305,7 +305,7 @@ settings = references: true templates: true -#### OPTIONAL CONFIGERABLE SETTINGS +## OPTIONAL CONFIGERABLE SETTINGS if process.env["SHARELATEX_LEFT_FOOTER"]? try @@ -322,9 +322,12 @@ if process.env["SHARELATEX_RIGHT_FOOTER"]? if process.env["SHARELATEX_HEADER_IMAGE_URL"]? settings.nav.custom_logo = process.env["SHARELATEX_HEADER_IMAGE_URL"] - -if process.env["SHARELATEX_HEADER"]? - settings.nav.header = process.env["SHARELATEX_HEADER_NAV_LINKS"] + +if process.env["SHARELATEX_HEADER_NAV_LINKS"]? + try + settings.nav.header = JSON.parse(process.env["SHARELATEX_HEADER_NAV_LINKS"]) + catch e + console.error("could not parse SHARELATEX_HEADER_NAV_LINKS, not valid JSON") # if process.env["SHARELATEX_PROXY_LEARN"]? # settings.nav.header.push({text: "help", class: "subdued", dropdown: [{text: "documentation", url: "/learn"}] })