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

Figure captions show above photo and push photo off screen on click #70

Open
AmritPatel opened this issue Mar 11, 2022 · 0 comments
Open

Comments

@AmritPatel
Copy link

Everything appears to be working just fine except the strange behavior when adding the caption="some text" field in either a standalone figure or gallery block.

As long as I specify an empty string for the caption field, everything works as expected. For example, consider the following snippet:

{{< load-photoswipe >}}

{{< figure src="posts/2022-03-11-hugo-easy-gallery-trial/minnie.jpg"
    caption-position="bottom" 
    caption-effect="slide"
    caption="">}}

{{< gallery >}}
  {{< figure src="/images/2018-08-05-havana/20180805-havana-01.jpg" >}}
  {{< figure src="/images/2018-08-05-havana/20180805-havana-02.jpg" >}}
  {{< figure src="/images/2018-08-05-havana/20180805-havana-03.jpg" caption="">}}
{{< /gallery >}}

When I click on the rendered image in-browser, I see:

Screen Shot 2022-03-11 at 3 54 47 PM

However, I would like to see the caption when I click the image. So if I replace the empty string with a non-empty string (i.e., if I provide a caption), then I get strange offsetting behavior in the image below when I click it in-browser.

{{< load-photoswipe >}}

{{< figure src="posts/2022-03-11-hugo-easy-gallery-trial/minnie.jpg"
    caption-position="bottom" 
    caption-effect="slide"
    caption="This is my favorite portrait of Minnie.">}}

{{< gallery >}}
  {{< figure src="/images/2018-08-05-havana/20180805-havana-01.jpg" >}}
  {{< figure src="/images/2018-08-05-havana/20180805-havana-02.jpg" >}}
  {{< figure src="/images/2018-08-05-havana/20180805-havana-03.jpg" caption="">}}
{{< /gallery >}}

Screen Shot 2022-03-11 at 3 56 50 PM

I created a sample website post (markdown) that reproduces this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant