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] mermaid and lightgallery don't work #1391

Closed
dre4merp opened this issue Dec 5, 2024 · 10 comments
Closed

[BUG] mermaid and lightgallery don't work #1391

dre4merp opened this issue Dec 5, 2024 · 10 comments
Labels
bug Something isn't working

Comments

@dre4merp
Copy link

dre4merp commented Dec 5, 2024

Describe the bug 描述你遇到的错误

mermaid

It works locally, but faild by github action.

lightgallery

config entry is true, but doesn't work.

Expected behavior 期待的行为

mermaid and lightgallery work successfully

Screenshots 屏幕截图

image

Build Environment 构建环境

Local

  • OS : Windows 10
  • hugo : v0.139.3

github action

  • OS : ubuntu-lateset
  • hugo : v0.139.3
name: deploy

on:
    push:
    workflow_dispatch:

jobs:
    build:
        runs-on: ubuntu-latest
        concurrency:
            group: ${{ github.workflow }}-${{ github.ref }}
        steps:
            - name: Checkout
              uses: actions/checkout@v4
              with:
                  submodules: true
                  fetch-depth: 0

            - name: Setup Hugo
              uses: peaceiris/actions-hugo@v3
              with:
                  hugo-version: '0.139.3'
                  extended: true

            - name: Build Web
              run: hugo --minify

            - name: Deploy Web
              uses: peaceiris/actions-gh-pages@v3

Preview Environment 预览环境

  • OS: Win 10
  • Browser : Chrome

Additional Information 补充信息

[params]
  [params.page]
    lightgallery = true
@dre4merp dre4merp added the bug Something isn't working label Dec 5, 2024
@HEIGE-PCloud
Copy link
Owner

I cannot reproduce this

exampleSite deploying on GitHub Pages works fine https://pages.hugodoit.com/create-diagrams/

Mermaid not working is very weird, it does not need any explicit configs...

@dre4merp
Copy link
Author

In fact, the example site also failed on one of my computers, but succeeded on another. After checking the log, I found that it was a CDN problem. I don't know if it was a problem with my network or the CDN was contaminated.
After that, I checked my own site and found that there was no request for the mermaid js file at all.

image

image

This is the address of my site, you can visit it and try it. dre4merp's blog

@CXwudi
Copy link
Contributor

CXwudi commented Dec 19, 2024

@dre4merp I live in NA and your blog is not rendering the chart properly, while the example site renders fine

image
image

I am using Brave browser, which is literally a Chrome. I also checked on Android and it is the same result.

@HEIGE-PCloud
Copy link
Owner

@dre4merp Can you provide a minimal reproducible example?

@dre4merp
Copy link
Author

dre4merp commented Dec 20, 2024

@HEIGE-PCloud This is a copy of my site configuration, with just the articles section removed.
image
example.zip

I need to remind you again that my local test is normal. The problem only occurs when using the github action build.

Anyway, thank you very much for your help.

@HEIGE-PCloud
Copy link
Owner

Data race on .Scratch? I have no idea

Remote

WARN  Mermaid status <nil> https://heige-pcloud.github.io/example/authors/
WARN  Mermaid status <nil> https://heige-pcloud.github.io/example/about/
WARN  Mermaid status <nil> https://heige-pcloud.github.io/example/404.html
WARN  Mermaid code block found in /posts/example
WARN  Mermaid status <nil> https://heige-pcloud.github.io/example/
WARN  Mermaid status <nil> https://heige-pcloud.github.io/example/authors/dre4merp/
WARN  Mermaid status <nil> https://heige-pcloud.github.io/example/categories/
WARN  Mermaid status <nil> https://heige-pcloud.github.io/example/posts/
WARN  Mermaid status <nil> https://heige-pcloud.github.io/example/series/
WARN  Mermaid status <nil> https://heige-pcloud.github.io/example/2024/12/example/
WARN  Mermaid status <nil> https://heige-pcloud.github.io/example/tags/

Local

WARN  Mermaid code block found in /posts/example
WARN  Mermaid status <nil> https://heige-pcloud.github.io/example/categories/
WARN  Mermaid status <nil> https://heige-pcloud.github.io/example/about/
WARN  Mermaid status <nil> https://heige-pcloud.github.io/example/404.html
WARN  Mermaid status <nil> https://heige-pcloud.github.io/example/authors/
WARN  Mermaid status <nil> https://heige-pcloud.github.io/example/tags/
WARN  Mermaid status <nil> https://heige-pcloud.github.io/example/series/
WARN  Mermaid status <nil> https://heige-pcloud.github.io/example/authors/dre4merp/
WARN  Mermaid status <nil> https://heige-pcloud.github.io/example/posts/
WARN  Mermaid status <nil> https://heige-pcloud.github.io/example/
WARN  Mermaid status true https://heige-pcloud.github.io/example/2024/12/example/

https://github.com/HEIGE-PCloud/example/actions/runs/12429679671/job/34703644962

@HEIGE-PCloud
Copy link
Owner

gohugoio/hugo#8255

@HEIGE-PCloud
Copy link
Owner

#1409 This might work, can you try it out?

@HEIGE-PCloud
Copy link
Owner

To enable lightgallery, add a title to the image or use the image shortcode.

![image.png](image.png "title here is necessary")

{{< image src="image.png" >}}

@dre4merp
Copy link
Author

dre4merp commented Dec 23, 2024

#1409 This might work, can you try it out?

It works well !

To enable lightgallery, add a title to the image or use the image shortcode.

![image.png](image.png "title here is necessary")

{{< image src="image.png" >}}

I finally figured out what the problem was!

My problem has been solved, you can close this issue at any time.
Thank u very much for your help!

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

3 participants