hugo-theme-stack icon indicating copy to clipboard operation
hugo-theme-stack copied to clipboard

The displayed title contains `#`

Open L-Super opened this issue 2 years ago • 6 comments

What happened?

The displayed title contains #, this is different from the previous display image

Hugo version

v0.124.1

Theme version

v3.25.0

What browsers are you seeing the problem on?

Microsoft Edge

More information about the browser

Windows11,Android

Relevant log output

No response

Link to Minimal Reproducible Example

https://demo.stack.jimmycai.com/p/markdown-syntax-guide/#paragraph

L-Super avatar Apr 07 '24 12:04 L-Super

+1 Is there any option to turn off the # before every heading? @CaiJimmy

thangbuiq avatar Apr 17 '24 04:04 thangbuiq

+1 I have the same problem

ihuub avatar Apr 22 '24 09:04 ihuub

This can be fixed by adding an overwrite to the template.

Create render-heading.html in layouts/_default/_markup/and add the following snippet:

<h{{ .Level }} id="{{ .Anchor }}">
    <a href="#{{ .Anchor }}">{{ .Text | safeHTML }}</a>
</h{{ .Level }}>

(Derived from the original feature commit: https://github.com/CaiJimmy/hugo-theme-stack/commit/539c39d69a150d0024cde275b9c91b5365fa4ee1)

chrjsrayman avatar Apr 23 '24 12:04 chrjsrayman

Sorry for the late reply, I'll add an option to this feature when I have more time.

CaiJimmy avatar Apr 25 '24 07:04 CaiJimmy

By default, the # should only be visible on hover, like here: https://stack.jimmycai.com/config/image-processing#cover

getvictor avatar Apr 30 '24 19:04 getvictor

Should be fixed now with #1016, heading anchor can be enabled with the article.headingAnchor parameter.

CaiJimmy avatar May 02 '24 21:05 CaiJimmy