stripe off errors and kb from page titles

This commit is contained in:
Henry Oswald 2016-06-24 13:15:22 +01:00
parent d294117286
commit 9a3e621c9c

View file

@ -39,6 +39,13 @@ module.exports = WikiController =
if pageData.content?.length > 280 if pageData.content?.length > 280
if _.include(other_lngs, req.lng) if _.include(other_lngs, req.lng)
pageData.title = pageData.title.slice(0, pageData.title.length - (req.lng.length+1) ) pageData.title = pageData.title.slice(0, pageData.title.length - (req.lng.length+1) )
if pageData.title?.toLowerCase()?.indexOf("kb") == 0
pageData.title = pageData.title.slice(3)
if pageData.title?.toLowerCase()?.indexOf("errors") == 0
pageData.title = pageData.title.slice(7)
WikiController._renderPage(pageData, contents, res) WikiController._renderPage(pageData, contents, res)
else else
WikiController._getPageContent page, (error, pageData) -> WikiController._getPageContent page, (error, pageData) ->