Added alt="" to some <img> #103

Merged
fnetX merged 10 commits from :codeberg-9 into codeberg-9 2025-01-17 02:48:06 +01:00
Contributor

Hi!
Added a bunch of alt="" to various parts.

  • This work is done as I am trying finally succeed to sign my commit using SSH. Consider this a big mess, hopefully useful ;
  • No tests, hope there's no mistake. Did my best!
  • Some alt="" are left empty, feel free to fill them ;
  • There's still some <img> without <alt>.

Sorry/thanks!


Default PR text ## Checklist

The contributor guide contains information that will be helpful to first time contributors. There also are a few conditions for merging Pull Requests in Forgejo repositories. You are also welcome to join the Forgejo development chatroom.

Tests

  • I added test coverage for Go changes...
    • in their respective *_test.go for unit tests.
    • in the tests/integration directory if it involves interactions with a live Forgejo server.
  • I added test coverage for JavaScript changes...

Documentation

  • I created a pull request to the documentation to explain to Forgejo users how to use this change.
  • I did not document these changes and I do not expect someone else to do it.

Release notes

  • I do not want this change to show in the release notes.
  • I want the title to show in the release notes with a link to this pull request.
  • I want the content of the release-notes/<pull request number>.md to be be used for the release notes instead of the title.
Hi! Added a bunch of `alt=""` to various parts. - This work is done as I am _~trying~_ finally succeed to sign my commit using SSH. Consider this a big mess, hopefully useful ; - No tests, hope there's no mistake. Did my best! - Some `alt=""` are left empty, feel free to fill them ; - There's still some `<img>` without `<alt>`. Sorry/thanks! --- <details> <summary>Default PR text</summary> ## Checklist The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org). ### Tests - I added test coverage for Go changes... - [ ] in their respective `*_test.go` for unit tests. - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server. - I added test coverage for JavaScript changes... - [ ] in `web_src/js/*.test.js` if it can be unit tested. - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)). ### Documentation - [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change. - [ ] I did not document these changes and I do not expect someone else to do it. ### Release notes - [ ] I do not want this change to show in the release notes. - [ ] I want the title to show in the release notes with a link to this pull request. - [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title. </detail>
Contributor

Hi @AntoninDelFabbro thanks for your contribution.

  1. Probably (at least for most of the lines), this is rather intended to be for the original https://codeberg.org/forgejo/forgejo ?
  2. I don’t understand why to add empty alt="" tags. What is the reason for this?
Hi @AntoninDelFabbro thanks for your contribution. 1. Probably (at least for most of the lines), this is rather intended to be for the original https://codeberg.org/forgejo/forgejo ? 2. I don’t understand why to add empty `alt=""` tags. What is the reason for this?
Author
Contributor
  1. I was surprised too (that's why I have at first closed the PR) but @lejun who helped me can provide you his answer ;
  2. The alt attribute must be specified for the IMG and AREA elements. It is optional for the INPUT and APPLET elements.

-- https://www.w3.org/TR/html401/struct/objects.html#h-13.8
An alt is required, but I left them empty when:

  1. I didn't knew what to write or didn't had enough context ;
  2. Was technically unsure ;
  3. When the alt text could be identical to the text nearby — ex. <img src="tg-icon.png" alt="Telegram">Telegram.
1. I was surprised too (that's why I have at first closed the PR) but @lejun who helped me can provide you his answer ; 2. > The alt attribute must be specified for the IMG and AREA elements. It is optional for the INPUT and APPLET elements. -- https://www.w3.org/TR/html401/struct/objects.html#h-13.8 An alt is required, but I left them empty when: 1. I didn't knew what to write or didn't had enough context ; 2. Was technically unsure ; 3. When the alt text could be identical to the text nearby — ex. `<img src="tg-icon.png" alt="Telegram">Telegram`.
Owner

@AntoninDelFabbro Thank you! Please split your contribution:

  • send a PR to forgejo/forgejo to do the necessary changes within that codebase
  • then send a PR to Codeberg for the parts that we modified directly

Also note that we follow the more recent HTML5 standard: https://html.spec.whatwg.org/multipage/images.html#alt
The information you linked is still correct in this case, but the HTML5 guide has some improved guidelines and examples in my opinion.

@AntoninDelFabbro Thank you! Please split your contribution: - send a PR to forgejo/forgejo to do the necessary changes within that codebase - then send a PR to Codeberg for the parts that we modified directly Also note that we follow the more recent HTML5 standard: https://html.spec.whatwg.org/multipage/images.html#alt The information you linked is still correct in this case, but the HTML5 guide has some improved guidelines and examples in my opinion.
@ -35,3 +35,3 @@
}
return template.HTML(`<img loading="lazy" class="` + class + `" src="` + src + `" title="` + html.EscapeString(name) + `" width="` + sizeStr + `" height="` + sizeStr + `"/>`)
return template.HTML(`<img loading="lazy" alt="" class="` + class + `" src="` + src + `" title="` + html.EscapeString(name) + `" width="` + sizeStr + `" height="` + sizeStr + `"/>`)
First-time contributor

Should be merged upstream

Should be merged upstream
lejun left a comment
First-time contributor

Hi there, reviewed the file changes and looks like only the home.tmpl issues are Codeberg specific. Otherwise everything may be pushed upstream to Forgejo itself.

To give a bit more context:

  • I'm totally tech illiterate, but my kink is to read specs. That's why the changes were done by Antonin who's more used to HTML thingies.
  • Regarding the Forgejo versus Codeberg repo, it's totally my fault. I wasn't how the two repo communicated. Thought that most changes here were pushed upstream by default.
  • I'm well aware that the HTML5 is the spec used nowadays, I quoted the 4.01 to Antonin to put emphasis on what should be a standard since 1999. Rules stayed the same (Even though I'd rather have no alt than an empty one. Less bloat).

By the way (just want to point it out so that we can all gain in common practices, not being a jerk or anything), seems it was @fnetX who removed the alt in the home.tmpl file.

Hi there, reviewed the file changes and looks like only the home.tmpl issues are Codeberg specific. Otherwise everything may be pushed upstream to Forgejo itself. To give a bit more context: * I'm totally tech illiterate, but my kink is to read specs. That's why the changes were done by Antonin who's more used to HTML thingies. * Regarding the Forgejo versus Codeberg repo, it's totally my fault. I wasn't how the two repo communicated. Thought that most changes here were pushed upstream by default. * I'm well aware that the HTML5 is the spec used nowadays, I quoted the 4.01 to Antonin to put emphasis on what should be a standard since 1999. Rules stayed the same (Even though I'd rather have no alt than an empty one. Less bloat). By the way (just want to point it out so that we can all gain in common practices, not being a jerk or anything), seems it was @fnetX who removed the alt in the home.tmpl file.
@ -113,3 +113,3 @@
<p>Here are some links to the most important topics. You can find the full list of pages at the sidebar.</p>
<p><a href="` + FullURL + `wiki/Configuration" rel="nofollow">Configuration</a>
<a href="` + FullURL + `wiki/raw/images/icon-bug.png" rel="nofollow"><img src="` + FullURL + `wiki/raw/images/icon-bug.png" title="icon-bug.png" alt="images/icon-bug.png"/></a></p>
<a href="` + FullURL + `wiki/raw/images/icon-bug.png" rel="nofollow"><img src="` + FullURL + `wiki/raw/images/icon-bug.png" title="icon-bug.png" alt=""/></a></p>
First-time contributor

Should be merged upstream

Should be merged upstream
@ -2,3 +2,3 @@
<div class="grid" aria-label="{{ctx.Locale.Tr "aria.footer.links"}}">
<div class="branding not-mobile" aria-hidden="true">
<img src="https://design.codeberg.org/logo-kit/icon_inverted.svg">
<img src="https://design.codeberg.org/logo-kit/icon_inverted.svg" alt="{{ctx.Locale.Tr "logo"}}">
First-time contributor

Should be merged upstream

Should be merged upstream
fnetX marked this conversation as resolved
@ -8,3 +8,3 @@
<!-- the logo -->
<a class="item" id="navbar-logo" href="{{AppSubUrl}}/" aria-label="{{if .IsSigned}}{{ctx.Locale.Tr "dashboard"}}{{else}}{{ctx.Locale.Tr "home"}}{{end}}">
<img width="30" height="30" src="https://design.codeberg.org/logo-kit/icon_inverted.svg" aria-hidden="true">
<img width="30" height="30" src="https://design.codeberg.org/logo-kit/icon_inverted.svg" alt="{{ctx.Locale.Tr "logo"}}" aria-hidden="true">
First-time contributor

Should be merged upstream

Should be merged upstream
@ -151,3 +151,3 @@
<section id="home-section-support">
<h3>Your support helps us grow!<img src="{{AssetUrlPrefix}}/img/svg/codeberg-icon-hearts.svg" role="img" aria-label="Hearts" aria-hidden="true"></h3>
<h3>Your support helps us grow!<img src="{{AssetUrlPrefix}}/img/svg/codeberg-icon-hearts.svg" role="img" alt="Hearts" aria-label="Hearts" aria-hidden="true"></h3>
First-time contributor

Seems Codeberg specific

Seems Codeberg specific
@ -364,3 +364,3 @@
</div>
</div>
<img class="tw-hidden" src="{{AssetUrlPrefix}}/img/forgejo-loading.svg" width="256" height="256">
<img class="tw-hidden" src="{{AssetUrlPrefix}}/img/forgejo-loading.svg" alt="{{ctx.Locale.Tr "loading"}}" width="256" height="256">
First-time contributor

Should be merged upstream

Should be merged upstream
@ -73,2 +73,2 @@
<span class="before-container"><img class="image-before"></span>
<span class="after-container"><img class="image-after"></span>
<span class="before-container"><img class="image-before" alt="{{ctx.Locale.Tr "repo.diff.file_before"}}"></span>
<span class="after-container"><img class="image-after" alt="{{ctx.Locale.Tr "repo.diff.file_after"}}"></span>
First-time contributor

Should be merged upstream

Should be merged upstream
@ -613,3 +613,3 @@
<div class="timeline-item event" id="{{.HashTag}}">
<a class="timeline-avatar"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>
<img src="{{.Poster.AvatarLink $.Context}}" width="40" height="40">
<img src="{{.Poster.AvatarLink $.Context}}" alt="" width="40" height="40">
First-time contributor

Should be merged upstream

Should be merged upstream
@ -10,3 +10,3 @@
<div id="repo_migrating" class="sixteen wide center aligned centered column" data-migrating-task-id="{{.MigrateTask.ID}}">
<div>
<img src="{{AssetUrlPrefix}}/img/forgejo-loading.svg" width="256" height="256">
<img src="{{AssetUrlPrefix}}/img/forgejo-loading.svg" alt="{{ctx.Locale.Tr "loading"}}" width="256" height="256">
First-time contributor

Should be merged upstream

Should be merged upstream
@ -22,3 +22,3 @@
<div class="view-raw">
{{if .IsImageFile}}
<img src="{{$.RawFileLink}}">
<img src="{{$.RawFileLink}}" alt="">
First-time contributor

Should be merged upstream

Should be merged upstream
@ -27,2 +26,3 @@
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/wechatwork.png" alt="">
{{else if eq .HookType "packagist"}}
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/packagist.png">
<img width="{{$size}}" height="{{$size}}" src="{{AssetUrlPrefix}}/img/packagist.png" alt="">
First-time contributor

Should be merged upstream

Should be merged upstream
@ -2,3 +2,3 @@
<div class="inline field tw-text-center">
<input type="hidden" name="img-captcha-id" value="{{.Captcha}}">
<img style="transform: scaleX(-1)" onclick="this.src=`{{AppSubUrl}}/captcha/{{.Captcha}}.png?reload=${Date.now()}`" class="captcha-img" src="{{AppSubUrl}}/captcha/{{.Captcha}}.png">
<img style="transform: scaleX(-1)" onclick="this.src=`{{AppSubUrl}}/captcha/{{.Captcha}}.png?reload=${Date.now()}`" class="captcha-img" src="{{AppSubUrl}}/captcha/{{.Captcha}}.png" alt="{{ctx.Locale.Tr "captcha"}}">
First-time contributor

Should be merged upstream

Should be merged upstream
@ -89,3 +89,3 @@
{{$commitLink := printf "%s/commit/%s" $repoLink .Sha1}}
<div class="flex-text-block">
<img class="ui avatar" src="{{$push.AvatarLink $.Context .AuthorEmail}}" title="{{.AuthorName}}" width="16" height="16">
<img class="ui avatar" src="{{$push.AvatarLink $.Context .AuthorEmail}}" alt="" title="{{.AuthorName}}" width="16" height="16">
First-time contributor

Should be merged upstream

Should be merged upstream
Author
Contributor
Done! & https://codeberg.org/forgejo/forgejo/pulls/6506
fnetX merged commit 94d10b98cb into codeberg-9 2025-01-17 02:48:06 +01:00
fnetX referenced this pull request from a commit 2025-01-17 02:48:07 +01:00
Gusted referenced this pull request from a commit 2025-04-02 20:59:28 +02:00
Gusted referenced this pull request from a commit 2025-04-02 20:59:28 +02:00
fnetX referenced this pull request from a commit 2025-05-24 14:56:35 +02:00
fnetX referenced this pull request from a commit 2025-05-24 14:56:35 +02:00
Gusted referenced this pull request from a commit 2025-10-25 23:35:04 +02:00
Gusted referenced this pull request from a commit 2025-10-25 23:35:04 +02:00
Gusted referenced this pull request from a commit 2025-10-26 07:14:57 +01:00
Gusted referenced this pull request from a commit 2025-10-26 07:14:57 +01:00
Gusted referenced this pull request from a commit 2025-11-03 03:11:25 +01:00
Gusted referenced this pull request from a commit 2025-11-03 03:11:25 +01:00
Gusted referenced this pull request from a commit 2025-11-11 07:18:51 +01:00
Gusted referenced this pull request from a commit 2025-11-11 07:18:51 +01:00
Gusted referenced this pull request from a commit 2025-11-21 07:30:22 +01:00
Gusted referenced this pull request from a commit 2025-11-21 07:30:22 +01:00
Gusted referenced this pull request from a commit 2025-12-09 01:10:51 +01:00
Gusted referenced this pull request from a commit 2025-12-09 01:10:51 +01:00
Gusted referenced this pull request from a commit 2025-12-22 01:49:08 +01:00
Gusted referenced this pull request from a commit 2025-12-22 01:49:08 +01:00
Gusted referenced this pull request from a commit 2026-01-13 19:44:17 +01:00
Gusted referenced this pull request from a commit 2026-01-13 19:44:17 +01:00
Gusted referenced this pull request from a commit 2026-01-15 19:23:33 +01:00
Gusted referenced this pull request from a commit 2026-01-15 19:23:33 +01:00
Gusted referenced this pull request from a commit 2026-01-17 22:47:27 +01:00
Gusted referenced this pull request from a commit 2026-01-17 22:47:28 +01:00
Gusted referenced this pull request from a commit 2026-01-20 15:59:44 +01:00
Gusted referenced this pull request from a commit 2026-01-20 15:59:45 +01:00
Gusted referenced this pull request from a commit 2026-01-26 00:45:48 +01:00
Gusted referenced this pull request from a commit 2026-01-26 00:45:48 +01:00
Gusted referenced this pull request from a commit 2026-01-27 20:15:31 +01:00
Gusted referenced this pull request from a commit 2026-01-27 20:15:31 +01:00
Gusted referenced this pull request from a commit 2026-01-28 14:25:59 +01:00
Gusted referenced this pull request from a commit 2026-01-28 14:25:59 +01:00
Gusted referenced this pull request from a commit 2026-02-08 01:18:00 +01:00
Gusted referenced this pull request from a commit 2026-02-08 01:18:02 +01:00
Gusted referenced this pull request from a commit 2026-02-25 01:19:16 +01:00
Gusted referenced this pull request from a commit 2026-02-25 01:19:18 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Codeberg-Infrastructure/forgejo!103
No description provided.