Add favicon

main
Bob Mottram 2020-05-29 13:28:12 +01:00
parent 370b8ffc4c
commit 165b79cc42
3 changed files with 40 additions and 0 deletions

View File

@ -202,6 +202,11 @@ If you want to use a particular font then copy it into the *fonts* directory, re
systemctl restart epicyon
```
## Custom Favicon
If you want to use your own favicon then copy your `favicon.ico` file to the base directory where you installed Epicyon.
## Adding Themes
If you want to add a new theme then open `theme.py` and add the theme name to the list within `getThemesList`. Add a function with the name `setTheme[YourThemeName]`. Have a look at the other themes to get an idea of how to set the colors and fonts.

View File

@ -1815,6 +1815,41 @@ class PubServer(BaseHTTPRequestHandler):
self._404()
return
# favicon image
if '/favicon.ico' in self.path:
# custom favicon
mediaFilename = \
self.server.baseDir + '/favicon.ico'
if not os.path.isfile(mediaFilename):
# default favicon
mediaFilename = \
self.server.baseDir + '/img/icons/favicon.ico'
if self._etag_exists(mediaFilename):
# The file has not changed
self._304()
return
if self.server.iconsCache.get(mediaStr):
mediaBinary = self.server.iconsCache[mediaStr]
self._set_headers_etag(mediaFilename,
'image/png',
mediaBinary, cookie,
callingDomain)
self._write(mediaBinary)
return
else:
if os.path.isfile(mediaFilename):
with open(mediaFilename, 'rb') as avFile:
mediaBinary = avFile.read()
self._set_headers_etag(mediaFilename,
'image/png',
mediaBinary, cookie,
callingDomain)
self._write(mediaBinary)
self.server.iconsCache[mediaStr] = mediaBinary
return
self._404()
return
self._benchmarkGETtimings(GETstartTime, GETtimings, 22)
# cached avatar images

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB