I have a website hosted on Github pages, where storage space is limited to 1 GB. The website is multilingual. Translations go in language subfolders.
defaultContentLanguageInSubdir = true
canonifyURLs = true
removePathAccents = true
[languages]
[languages.en]
languagename = "English"
weight = 1
[languages.fr]
languagename = "Français"
weight = 2
Some images (app screenshots) are translated (using .en.jpg
or .fr.jpg
as extensions). Most of them are not (using .jpg
as extension).
These images use responsive sizes (HTML <img src=" " srcset=" " sizes=" "). The
srcset` sequence of images is computed by Hugo:
{{ $image = resources.Get $src }}
{{ $set := slice }}
{{ range slice 400 600 800 1000 1200 1400 1600 1800 2000 2200 2400 2600 2800 3000 }}
{{ if lt . $image.Width }}
{{ $size := print . "x" .}}
{{ $thumb := $image.Fit $size }}
{{ $set = $set | append (printf ("%s %dw") $thumb.RelPermalink $thumb.Width ) }}
{{ end }}
{{ end }}
{{ if gt (len $set) 0 }}
{{ $srcset = delimit $set ", "}}
{{ end }}
My problem is that non-translated images are duplicated in both /en/
and /fr/
language directories, using storage space for nothing. How could I prevent that ?