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 += \ htmlStr += \
'\n <center>\n' + \ '\n <center>\n' + \
' <img class="leftColImg" ' + \ ' <img class="leftColImg" ' + \
'alt="' + translate['Left column image'] + '" ' + \
'loading="lazy" src="/users/' + \ 'loading="lazy" src="/users/' + \
nickname + '/' + leftImageFile + '" />\n' + \ nickname + '/' + leftImageFile + '" />\n' + \
' </center>\n' ' </center>\n'

View File

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

View File

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

View File

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

View File

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