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] linkFullImages 404 not found #1565

Open
MortalHappiness opened this issue Aug 6, 2024 · 1 comment · May be fixed by #1566
Open

[BUG] linkFullImages 404 not found #1565

MortalHappiness opened this issue Aug 6, 2024 · 1 comment · May be fixed by #1566
Labels
bug Something isn't working

Comments

@MortalHappiness
Copy link

MortalHappiness commented Aug 6, 2024

Describe the bug

  • Device/Os: Linux Mint 21.3 Cinnamon
  • Type: Desktop
  • Browser and version [e.g. Chrome 86.0]: Chrome Version 127.0.6533.88 (Official Build) (64-bit)
  • Hugo Version [ >=0.112.4 expected]: 0.128.2
  • Theme Version [e.g. v4.0, master, or commit-id ]: master

Steps to reproduce the behavior:

  1. Checkout to exampleSite branch.
  2. Change config.yml such that params.cover.linkFullImages is set to true.
  3. Run hugo server -D
  4. Click the cover image in the "Markdown Syntax Guide" page
  5. See a 404 not found

Expected behavior:

No 404 not found.

Repo/Source where this issue can be reproduced:

Screenshots

image

Additional context

The URL is http://localhost:1313/hugo-PaperMod/posts/markdown-syntax/images/msg.png. However it should be http://localhost:1313/hugo-PaperMod/images/msg.png. I found the problem is due to this line:

{{- if $addLink }}<a href="{{ (path.Join .RelPermalink .Params.cover.image) | absURL }}" target="_blank"

Change it from (path.Join .RelPermalink .Params.cover.image) to (.Params.cover.image) solves the problem.

I'll create a PR if this solution is applicable.

@MortalHappiness MortalHappiness added the bug Something isn't working label Aug 6, 2024
MortalHappiness added a commit to MortalHappiness/hugo-PaperMod that referenced this issue Aug 6, 2024
@MortalHappiness MortalHappiness linked a pull request Aug 6, 2024 that will close this issue
7 tasks
@adityatelange
Copy link
Owner

Hi @MortalHappiness this is not a problem.

We have cover.relative parameter to let the code know if your image is located in the static folder (relative: false) or in the page bundle (relative: true).

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