fix custom logos not loading on fr and ko sites (ref #70)

This commit is contained in:
orenom
2022-07-23 19:01:00 +02:00
parent a294c51118
commit f898d7b546
4 changed files with 30 additions and 5 deletions
+9 -1
View File
@@ -64,7 +64,15 @@ module.exports = (app, utils) => {
// custom wikipedia logos for different languages
if(req.url.startsWith('/static/images/mobile/copyright/')) {
const custom_logo = customLogos(req)
let custom_lang = ''
if(req.url.includes('-fr.svg')) {
custom_lang = 'fr'
}
if(req.url.includes('-ko.svg')) {
custom_lang = 'ko'
}
const custom_logo = customLogos(req.url, custom_lang)
if(custom_logo) {
return res.sendFile(custom_logo)
}
+3 -4
View File
@@ -453,10 +453,9 @@ module.exports = function(redis) {
return `${static_path}/wikiless-favicon.ico`
}
this.customLogos = (req) => {
const lang = getLang(req)
if(lang === 'fr') {
return path.join(__dirname, '..', 'static', 'fr', path.basename(req.url))
this.customLogos = (url, lang) => {
if(validLang(lang)) {
return path.join(__dirname, '..', 'static', lang, path.basename(url))
}
return false
}
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 10 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 15 KiB