Link to cached favicons

main
Bob Mottram 2021-12-16 21:27:50 +00:00
parent 71cf29629a
commit 2e681f5b58
1 changed files with 4 additions and 0 deletions

View File

@ -240,6 +240,10 @@ def _htmlNewswire(baseDir: str, newswire: {}, nickname: str, moderator: bool,
faviconUrl = getNewswireFaviconUrl(url)
faviconLink = ''
if faviconUrl:
favBase = '/favicons/' + faviconUrl.replace('/', '#')
cachedFaviconFilename = baseDir + favBase
if os.path.isfile(cachedFaviconFilename):
faviconUrl = favBase
faviconLink = \
'<img loading="lazy" src="' + faviconUrl + '" ' + \
'alt="" ' + _getBrokenFavSubstitute() + '/>'