Mandatory Alt Text Field in Image and Markdown Widgets
- Dominant language
- JavaScript
- Stars
- 19.4k
- Forks
- 3.1k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 9
Description
**Is your feature request related to a problem? Please describe.**
Image `alt` text is crucial for SEO and accessibility, yet in both the `Image` and `Markdown` widgets, there currently seems to be no way to enforce the `alt` text field as mandatory. This omission can lead to scenarios where images are uploaded without the necessary `alt` text, which is not ideal for SEO and accessibility compliance.
**Describe the solution you'd like**
I propose an enhancement to make the `alt` text field a required field in both the `Image` and `Markdown` widgets. This feature would ensure that users cannot bypass entering the `alt` text when uploading images, thereby enhancing SEO and accessibility.
**Describe alternatives you've considered**
An interim workaround I've considered involves using separate `image` and `string` widgets as follows:
```
- label: "Image"
name: "image"
widget: "image"
required: true
- label: "Image Alt Text"
name: "alt"
widget: "string"
required: true
```
While this workaround serves the purpose, it is not as streamlined or user-friendly as having an integrated mandatory `alt` text field within the existing widgets.
**Additional context**
A related issue was discussed in [this GitHub issue](https://github.com/decaporg/decap-cms/issues/6326) where the community member requested making fields within a `Markdown` widget required. Unfortunately, that issue was closed due to inactivity.


Contributor guide
Assessment
This issue has not been assessed yet.