Images in pages have no size, no lazy loading and no async decoding

Abierto
#681 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@guidol-ive ya está trabajando en esto.

Desde el 28/10/2026.

  • #684 de @guidol-ive — abierto

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
javascript
Área
backend

Línea de trabajo

The issue names images in page and article content stored in data/images/, and links PR #684; inspect that pull request first to see the work already underway. The expected result is dimensions from image files when absent, preserved existing attributes, height: auto, lazy loading except for the first image, and async decoding on every image.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Impact: Medium Level: Easy Type: Enhancement Value: Visitors

Problem

Images in the text of a page or an article (<img> from the editor) are sent as they were saved:

  • without width and height, so the text jumps down while each image loads (Lighthouse: "Image elements do not have explicit width and height", Cumulative Layout Shift);
  • without loading="lazy", so a long article loads every image at once, also the ones far below the fold;
  • without decoding="async", so decoding a large image can hold up the rest of the page.

A page of a large publisher compared with a Hypha page: of 206 images, 205 have loading="lazy" and 201 have a size; on the Hypha front page none of 17 has loading="lazy" and 1 has a size.

#672 (PR #673) handles the teasers of articles. This issue is about the images in the content itself.

Expected

  • An image stored in data/images/ gets its width and height from the file when the editor did not set them, and a style rule keeps its proportions when a theme scales it (height: auto).
  • Every image except the first one in the page gets loading="lazy": the first one is often the largest image in view (Largest Contentful Paint) and should load at once.
  • Every image gets decoding="async".
  • Attributes that are already set (by the editor or a theme) are kept.
Lenguaje dominante
JavaScript
Estrellas
5
Forks
9
Merge medio
18 h 49 min
PR fusionados (30 d)
13

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de PlanBCode/hypha

Todos los issues de PlanBCode/hypha

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.