jetthoughts / jetthoughts.github.io

0 stars 0 forks source link

[EPIC] Use pre-processed images everywhere #108

Open AucT opened 6 days ago

AucT commented 6 days ago

Use everywhere webp processed images. Let's skip processing only for favicons (generated by another service).

As a result, all assets are stored in assets/img; images are processed and set in explicit web format and are fingerprinted. There is a partial that helps quickly remove duplication by providing the path, name, and sizes to render the image.

Could you make sure it's easy to render image tags and reduce the number of duplications? Instead of:

Before:

{{ $image := resources.Get  "path" }}
{{ partial "img/hero-big.html" (dict "image" $image "title" $title) }}

After:

{{ partial "img/hero-big.html" (dict "image" "path" "title" $title) }}

Also, make sure that CSS has links to the processed images.