Skip to content

cover image: the original image duplicates with its md5-named copy #927

@Elypha

Description

@Elypha

What happened?

desc

I'm testing this on the starter project with no modifications for reproducibility

2024-01-13_02-33-40_396

I'm not sure if this is intended, but it seems that we get 2 images with the same 'content' under /public

reproduce

you only need the related recommendation feature in hugo config being enabled, which is by default, and hugo

codes

it seems that the following codes are related

https://github.com/CaiJimmy/hugo-theme-stack/blob/master/layouts/partials/article/components/related-content.html#L8 calls article-list/tile and the md5 duplication is created at https://github.com/CaiJimmy/hugo-theme-stack/blob/master/layouts/partials/article-list/tile.html#L8 when $imageRaw is referred to at line 9.

idea

my personal idea is to keep only the md5-named image in the build, and exclude the original unrenamed image. however, I notice that the original image name is used in some meta tag for opengraph, so this may require some more effort.

but the problem is purely about storage worries. any other method would also work so long as it prevents duplication

Hugo version

hugo v0.121.1-00b46fed8e47f7bb0a85d7cfc2d9f1356379b740+extended windows/amd64 BuildDate=2023-12-08T08:47:45Z VendorInfo=gohugoio

Theme version

current latest master: 21da06e

What browsers are you seeing the problem on?

Chrome

More information about the browser

No response

Relevant log output

No response

Link to Minimal Reproducible Example

https://github.com/Elypha/hugo-theme-stack-starter

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions