this renders fine in the page. however, if i click on the image, the href points directly to /images/post01/img01.jpg which is not created.
i would, however, like to show the original image when i click on the preview.
in /public/images/post01/ hugo only creates Lanczos compressed images like
Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.
If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.
i updated, stript the code and uploaded it to github:
as from my original post and dhre readme.md:
i’d like a 3 image gallery shortcode (3 image-preview in one row).
when clicking on an image it sould show enlarged (using Lightbox2 - or something similar)
in the enlarged view i’d like to be able to cycle through the 3 images (something that lightbox should provide internally)
problem: hugo processes every image and only creates resized versions of my original image, so a “href=…” link isn’t found later…
yes, i understand that. it’s good, that hugo resizes and compresses, as this saves bandwith and speeds up rendering… i use “Size” “200x200” (in {{ partial “image” … }} as i’d like to have my thumbnails smaller (and in identical size) and also to resized (and therefore to save bandwidth)
but: if the user wants to see the full image, it should (on demand) get the full-size image
i could, of course, prepare a thumbnail and a full-size image and use the thumbnail in the gallery and the full-size in the href… but this should be automatic
also: in my post-2 (My Gallery 2) i DO NOT use partial “image”… at all. i just use
No idea. I can’t clone your repo as I haven’t Go installed. And I’m not going to. Others might be able to help. It might help them if you pared down your repo to the absolute necessary demonstrating the issue.
First, you created your shortcodes in themes/hugoplate/layouts/shortcodes. If you ever update/remove the theme you will lose your customizations and additions. When you use a theme, don’t ever modify it. Instead, override the theme by placing files in the layouts directory in the root of your project.
Second, you need to capture the original images (before passing them through the image partial) as resources, then call the resource RelPermalink method to publish the original image and return its path.
I also appreciate your comment on “never modify a theme”:
as i did not find a /layout/ folder in the root directory, I thought there’s no other way than using the theme’s layout-folder.
following your comment, I now just created /layout/shortcodes/ in the root directory an that is working great