mirror of
https://github.com/Metastem/wikiless
synced 2024-12-06 19:16:58 +01:00
fix custom logos not loading on fr and ko sites (ref #70)
This commit is contained in:
+9
-1
@@ -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
@@ -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 |
Reference in New Issue
Block a user