Images in pages have no size, no lazy loading and no async decoding
Los mantenedores suelen responder en 1 día
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
Problem
Images in the text of a page or an article (<img> from the editor) are sent as they were saved:
- without
widthandheight, 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 itswidthandheightfrom 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
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de PlanBCode/hypha
-
Component: User interface Impact: Low Level: Easy Pagetype: Peer reviewed article Type: Bug Value: Visitors
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Impact: Medium Level: Easy Type: Bug Value: Users
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Impact: Low Level: Easy Pagetype: Festival Type: Bug Value: Coders
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Impact: Medium Level: Easy Pagetype: Mailinglist Type: Bug Value: Users
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
Los mantenedores suelen responder en 1 día
-
Impact: Low Level: Easy Type: Bug Value: Coders
Dificultad 1/5 1-3 horas Aptitud para principiantes 85/100
PlanBCode/hypha#586 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de PlanBCode/hypha
Issues similares
-
Upgrade listener stays on a custom server after close when `preClose` is setPosiblemente ocupada @RaphaelFakhri la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
fastify/fastify-websocket#388 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
DietrichGebert/ponytail#1343 ·
Los mantenedores suelen responder en 1 día
-
cleanup
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
swombat/souls-house#770 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día