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]: Code box not rendering properly #863

Closed IHKYoung closed 1 year ago

IHKYoung commented 1 year ago

What happened?

The code box portion is not being rendered properly, as shown below:

image

Hugo version

0.117, 0.99.1 were all tested, and the effect suppression

Theme version

3.18.0

What browsers are you seeing the problem on?

Chrome, Safari

More information about the browser

No response

Relevant log output

No response

Link to the page with bug

https://ahaknow.com

Link to the source repository

No response

CaiJimmy commented 1 year ago

Try https://github.com/CaiJimmy/hugo-theme-stack/issues/695#issuecomment-1267181213

If it doesn't work, provide a minimal reproducible example using the starter template: https://github.com/CaiJimmy/hugo-theme-stack-starter. Otherwise, it is hard for me to figure out the problem since this problem does not appear on the test site (https://dev.stack.jimmycai.com/p/markdown-syntax-guide/)

IHKYoung commented 1 year ago

It looks like you're the one who didn't understand what I meant, the code box isn't being rendered properly, there's no serial number, there's no rendered highlighting, even if it's set properly

markup:
    goldmark:
        renderer:
            ## Set to true if you have HTML content inside Markdown
            unsafe: true
    tableOfContents:
        endLevel: 4
        ordered: true
        startLevel: 2
    highlight:
        noClasses: false
        codeFences: true
        guessSyntax: true
        hl_Lines: ""
        lineNoStart: 1
        lineNos: true
        lineNumbersInTable: true
        tabWidth: 4

Try #695 (comment)

If it doesn't work, provide a minimal reproducible example using the starter template: https://github.com/CaiJimmy/hugo-theme-stack-starter. Otherwise, it is hard for me to figure out the problem since this problem does not appear on the test site (https://dev.stack.jimmycai.com/p/markdown-syntax-guide/)

IHKYoung commented 1 year ago

I found the reason! 😄 It's that you need to configure it according to the latest hugo, for example using hugo.toml