Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Path to thumbnail images incorrect on second and higher page #427

Closed
4 tasks done
Cyb3r-Jak3 opened this issue Feb 19, 2023 · 1 comment · Fixed by #464
Closed
4 tasks done

[Bug] Path to thumbnail images incorrect on second and higher page #427

Cyb3r-Jak3 opened this issue Feb 19, 2023 · 1 comment · Fixed by #464
Labels
bug Something isn't working

Comments

@Cyb3r-Jak3
Copy link

I confirm:

Hugo version

hugo v0.109.0-47b12b83e636224e5e601813ff3e6790c191e371+extended windows/amd64 BuildDate=2022-12-23T10:38:11Z VendorInfo=gohugoio

Where is this bug showing up?

In the browser: Hugo builds the site, but something doesn't look right.

Operating system

Windows 10

Browser (if applicable)

No response

Current behavior

When you have posts that go on to a second page, then the thumbnails images all 404.

An example URL is http://localhost:1313/page/2/images/<folder>/image.png whereas on the first page the thumbnail images are linked to http://localhost:1313/images/<folder>/image.png

Expected behavior

All images that are loaded from the second page and higher still use the page of /images rather than /<page number>/images

Steps to reproduce

Create a project that has at least two pages of posts with thumbnails and go to the second page and there are no thumbnails.

Relevant log output

No response

Related code

My guess is that is comes from this partial
https://github.com/chipzoller/hugo-clarity/blob/master/layouts/partials/figure.html

    {{/* Render image and attributes. */}}
    <img
      loading="lazy"
      decoding="async"
      alt="{{ htmlEscape $alt }}"
      {{ with $image }}
        class="{{ $classes }} image_processed"
        width="{{ .Width }}"
        height="{{ .Height }}"
        src="{{ .RelPermalink }}"
      {{ else }}
        class="{{ $classes }} image_unprocessed"
        src="{{ $fileWeb }}"
      {{ end }}
      {{ with $cap }}
        title="{{ safeHTML $cap }}"
      {{ end }}
    />

Preferred solution

Maybe have the images link be src from absolute?

Other information

Similar to #337

@Cyb3r-Jak3 Cyb3r-Jak3 added the bug Something isn't working label Feb 19, 2023
dovideh added a commit to dovideh/hugo-clarity that referenced this issue Jul 11, 2023
@albersonmiranda
Copy link
Contributor

albersonmiranda commented Jun 14, 2024

Also happens with internationalization. When changing from default to second language, all thumbs are 404. Tested fix in #464 , it does works for multi language too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants