adityatelange / hugo-PaperMod

A fast, clean, responsive Hugo theme.
https://adityatelange.github.io/hugo-PaperMod/
MIT License
9.6k stars 2.59k forks source link

[BUG] linkFullImages 404 not found #1565

Open MortalHappiness opened 1 month ago

MortalHappiness commented 1 month ago

Describe the bug

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:

https://github.com/adityatelange/hugo-PaperMod/blob/9ea3bb0e1f3aa06ed7715e73b5fabb36323f7267/layouts/partials/cover.html#L12

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.