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] lightgallery not work on homepage #1381

Open
wu0407 opened this issue Nov 6, 2024 · 6 comments
Open

[BUG] lightgallery not work on homepage #1381

wu0407 opened this issue Nov 6, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@wu0407
Copy link
Contributor

wu0407 commented Nov 6, 2024

Describe the bug 描述你遇到的错误

If the summary contains an image that is unable browse use lightgallery.

Expected behavior 期待的行为

No response

Screenshots 屏幕截图

image
image
image

Build Environment 构建环境

hugo: v0.137.0

Preview Environment 预览环境

No response

Additional Information 补充信息

No response

@wu0407 wu0407 added the bug Something isn't working label Nov 6, 2024
@wu0407
Copy link
Contributor Author

wu0407 commented Nov 6, 2024

solution 1:

      --document.getElementById("content"),
      ++document.getElementsByClassName("content"),

DoIt/assets/js/theme.ts

Lines 586 to 590 in 324b48d

function initLightGallery() {
if (window.config.lightGallery) {
lightGallery(
document.getElementById("content"),
window.config.lightGallery,

solution 2:

---<div class="content"> 
++<div class="content" id="content"> 

<div class="content">

@HEIGE-PCloud
Copy link
Owner

HEIGE-PCloud commented Nov 6, 2024

I think that's expected? The images on the homepage serve as hyperlinks to the articles, so adding light gallery there will conflict with the link.

@wu0407
Copy link
Contributor Author

wu0407 commented Nov 6, 2024

I think that's expected? The images on the homepage serve as hyperlinks to the articles, so adding light gallery there will conflict with the link.

That image is not a featured image, it is the only image on the page. It links to image self not to the article.

@HEIGE-PCloud
Copy link
Owner

Ah I misunderstood you. Sounds like another feature creep into the summary #1368

@HEIGE-PCloud
Copy link
Owner

People disagree on this for a long time, some think summary should not have any styles at all, some others want their articles to be fully rendered in the summary. I think this is again one of these cases and I don't have a good opinion here.

@HEIGE-PCloud
Copy link
Owner

The current state is "The basic markdown stuff works", so headings, lists and tables will be rendered with the right style, but anything involving fancy JavaScripts probably does not work.

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

No branches or pull requests

2 participants