CaiJimmy / hugo-theme-stack

Card-style Hugo theme designed for bloggers
https://stack.jimmycai.com
GNU General Public License v3.0
5.06k stars 1.66k forks source link

[Bug]: 图片如果上下不空行,就无法点击放大 #844

Closed pendj closed 1 year ago

pendj commented 1 year ago

What happened?

如题,我使用的最新版(2023/07/20)hugo-theme-stack-starter工程创建的项目,也通过git clone主题的方式试过,都复现了标题中的问题.

进入`YouTube Data API v3`,点击`启用`

![img_1.png](img_1.png)

进入`YouTube Data API v3`API/服务详情,点击创建凭据

像上面这样就可以点击放大或分享.

进入`YouTube Data API v3`,点击`启用`
![img_1.png](img_1.png)
进入`YouTube Data API v3`API/服务详情,点击创建凭据

像上面这样就无法点击放大或分享,甚至必须得上下两行都有空行. 能不能去掉上下两行空格,否则很影响编写习惯.

Hugo version

v0.115.3

Theme version

3.17.0

What browsers are you seeing the problem on?

Chrome

More information about the browser

No response

Relevant log output

No response

Link to the page with bug

https://demo.stack.jimmycai.com

Link to the source repository

No response

rmdhnreza commented 1 year ago

I am using the development build (using a submodule) and I am not affected by this bug. However, without an empty line, the image indent with a list.

https://github.com/CaiJimmy/hugo-theme-stack/assets/23427492/e61922f8-4fd6-4282-bdff-3341fbc6d0f4

pendj commented 1 year ago

@rmdhnreza Appreciate your answer,but i don't find out where to download the development build. You can use the latest version to verify my issue.

CaiJimmy commented 1 year ago

That's expected behaviour.

To create a gallery (with a lightbox effect), the paragraph can only contain images. This check is done here: https://github.com/CaiJimmy/hugo-theme-stack/blob/13568d8ff0f789c28c7caaa49e6ef78effc5f47a/assets/ts/gallery.ts#L66

That's why you need to leave empty lines before and after the image so that it's treated as a separate paragraph.

pendj commented 1 year ago

@CaiJimmy Appreciate your answer,I figure it out why it's happening.But this seems to be a flaw in your scheme.Isn't there another way to solve the empty lines problem?It changes the way of somebody writing markdown.