Skip to content

Propose CI tests to validate mandatory ALT text for new content #708

@TineoC

Description

@TineoC

Proposed Solution

Implement a CI check that validates Markdown files for the presence of alt text in both Markdown image syntax ![]() and HTML <img> tags.

Requirements

  • Scan Scope: All Markdown files under content/en/.
  • Validation Rules:
    • Fail if an image tag is empty: ![ ](...).
    • Fail if an <img> tag lacks an alt attribute.
    • (Optional) Fail if alt text is generic (e.g., "image", "screenshot", "placeholder").
  • Exemptions: Allow a specific override if an image is purely decorative (e.g., alt=""), though this should be rare for blog content.

Implementation Ideas

  1. Markdown Linting: Use markdownlint with a custom rule.
  2. Custom Script: A Python or Go script that parses the AST of the Markdown files.
  3. Vale: Integrate a rule into our existing Vale configuration to check for accessibility standards in image descriptions.

Impact

  • SEO: Better indexation in Google Image Search.

/area accessibility
/area seo
/kind feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions