hugo-PaperMod
hugo-PaperMod copied to clipboard
how to enable code block highlights?
Hello, i jsut forked and deploy it through github pages.
I just copy & paste markdown syntax guide in sample page but code block highlights doesnt work.
url : https://cha2hyun.github.io/posts/etc/markdown-syntac-guide/ repo : https://github.com/cha2hyun/blog/blob/master/content/posts/Etc/markdown%20syntac%20guide.md
any help for this issue ?🙏
Self Answer 🥹
- change the config.yml
- if anyone has same problem, you might copied config.yml from here(https://github.com/adityatelange/hugo-PaperMod/blob/exampleSite/config.yml) and its default value is disableHLJS:true
config.yml
assets:
# disableHLJS: true <- disable here and highlights will work
Looks like you might need to generate the stylesheet: https://github.com/adityatelange/hugo-PaperMod/issues/901
Make sure you link the style once generated (In your config)
The command will look like the one mentioned in the link above:
hugo gen chromastyles --style monokai --highlightStyle 'bg:#474733' > assets/css/extended/monokai.css
Looks like you might need to generate the stylesheet:
https://github.com/adityatelange/hugo-PaperMod/issues/901
Make sure you link the style once generated (In your config)
The command will look like the one mentioned in the link above:
hugo gen chromastyles --style monokai --highlightStyle 'bg:#474733' > assets/css/extended/monokai.css
Thanks. thats why my codeblock looks ugly. thanks for help i will try 👍
Method for enable code block when copied config.yml from exampleSite
-
If anyone has code block not highlighting issue like me, you might copied config.yml from here(https://github.com/adityatelange/hugo-PaperMod/blob/exampleSite/config.yml)
-
Make css file. (thanks for @TheQueenIsDead) Check > #901
# check your assets folder path
# In this command, it generate monokai.css
hugo gen chromastyles --style monokai --highlightStyle 'bg:#474733' > themes/PaperMod/assets/css/extended/monokai.css
- edit config.yml
markup:
highlight:
style: monokai
- done