Alt text for images

main
Bob Mottram 2021-02-01 18:38:08 +00:00
parent 203d628c5a
commit f767eb1796
5 changed files with 11 additions and 4 deletions

View File

@ -90,6 +90,7 @@ def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str,
htmlStr += \
'\n <center>\n' + \
' <img class="leftColImg" ' + \
'alt="' + translate['Left column image'] + '" ' + \
'loading="lazy" src="/users/' + \
nickname + '/' + leftImageFile + '" />\n' + \
' </center>\n'

View File

@ -92,6 +92,7 @@ def getRightColumnContent(baseDir: str, nickname: str, domainFull: str,
htmlStr += \
'\n <center>\n' + \
' <img class="rightColImg" ' + \
'alt="' + translate['Right column image'] + '" ' + \
'loading="lazy" src="/users/' + \
nickname + '/' + rightImageFile + '" />\n' + \
' </center>\n'

View File

@ -324,6 +324,7 @@ def _getProfileHeader(baseDir: str, httpPrefix: str,
nickname + '/' + defaultTimeline + '" title="' + \
translate['Switch to timeline view'] + '">\n'
htmlStr += ' <img class="profileBackground" ' + \
'alt="' + translate['Background image'] + '" ' + \
'src="/users/' + nickname + '/image_' + theme + '.png" /></a>\n'
htmlStr += ' <figcaption>\n'
htmlStr += \
@ -331,6 +332,7 @@ def _getProfileHeader(baseDir: str, httpPrefix: str,
nickname + '/' + defaultTimeline + '" title="' + \
translate['Switch to timeline view'] + '">\n' + \
' <img loading="lazy" src="' + avatarUrl + '" ' + \
'alt="' + translate['Avatar image'] + '" ' + \
' class="title"></a>\n'
htmlStr += ' <h1>' + displayName + '</h1>\n'
htmlStr += \
@ -403,6 +405,7 @@ def _getProfileHeaderAfterSearch(baseDir: str,
nickname + '/' + defaultTimeline + '" title="' + \
translate['Switch to timeline view'] + '">\n'
htmlStr += ' <img class="profileBackground" ' + \
'alt="' + translate['Background image'] + '" ' + \
'src="' + imageUrl + '" /></a>\n'
htmlStr += ' <figcaption>\n'
if avatarUrl:
@ -411,6 +414,7 @@ def _getProfileHeaderAfterSearch(baseDir: str,
translate['Switch to timeline view'] + '">\n'
htmlStr += \
' <img loading="lazy" src="' + avatarUrl + '" ' + \
'alt="' + translate['Avatar image'] + '" ' + \
' class="title"></a>\n'
htmlStr += ' <h1>' + displayName + '</h1>\n'
htmlStr += \

View File

@ -388,8 +388,9 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
'<a href="/users/' + nickname + '" title="' + \
translate['Switch to profile view'] + '" alt="' + \
translate['Switch to profile view'] + '">\n'
tlStr += '<img loading="lazy" class="timeline-banner" src="' + \
usersPath + '/' + bannerFile + '" /></a>\n' + \
tlStr += '<img loading="lazy" class="timeline-banner" ' + \
'alt="' + translate['Timeline banner image'] + '" ' + \
'src="' + usersPath + '/' + bannerFile + '" /></a>\n' + \
'</header>\n'
if fullWidthTimelineButtonHeader:

View File

@ -838,8 +838,8 @@ def htmlPostSeparator(baseDir: str, column: str) -> str:
if os.path.isfile(separatorImageFilename):
separatorStr = \
'<div class="' + separatorClass + '"><center>' + \
'<img src="/icons/' + filename + '"/>' + \
'</center></div>\n'
'<img src="/icons/' + filename + '" ' + \
'alt="" /></center></div>\n'
return separatorStr