Getting themed favicon

main
Bob Mottram 2020-11-14 12:02:12 +00:00
parent 5cb12b106b
commit 7dbf5bd939
2 changed files with 7 additions and 1 deletions

View File

@ -4382,8 +4382,12 @@ class PubServer(BaseHTTPRequestHandler):
if 'image/avif' in self.headers['Accept']: if 'image/avif' in self.headers['Accept']:
favType = 'image/avif' favType = 'image/avif'
favFilename = 'favicon.avif' favFilename = 'favicon.avif'
themeName = getConfigParam(baseDir, 'theme')
if not themeName:
themeName = 'default'
# custom favicon # custom favicon
faviconFilename = baseDir + '/' + favFilename faviconFilename = \
baseDir + '/theme/' + themeName + '/icons/' + favFilename
if not os.path.isfile(faviconFilename): if not os.path.isfile(faviconFilename):
# default favicon # default favicon
faviconFilename = \ faviconFilename = \

View File

@ -483,6 +483,8 @@ def createPerson(baseDir: str, nickname: str, domain: str, port: int,
baseDir + '/accounts/' + nickname + '@' + domain + baseDir + '/accounts/' + nickname + '@' + domain +
'/avatar.png') '/avatar.png')
theme = getConfigParam(baseDir, 'theme') theme = getConfigParam(baseDir, 'theme')
if not theme:
theme = 'default'
defaultProfileImageFilename = baseDir + '/img/image.png' defaultProfileImageFilename = baseDir + '/img/image.png'
if theme: if theme:
if os.path.isfile(baseDir + '/img/image_' + theme + '.png'): if os.path.isfile(baseDir + '/img/image_' + theme + '.png'):