How to add custom highlighting #119
-
Hey, I read issue #35 but I am unable to use highlight.js to use monokai syntax highlighting. Can you please give some detailed steps using which I can add custom highlight. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 10 comments 2 replies
-
em.. first, add your highlight sample is here |
Beta Was this translation helpful? Give feedback.
-
@pacientes So I have to change the theme's original file? Is there any way of adding highlights without changing the original file? I am asking cause for the build I am using submodule + github action so modifying it on my own repo would be difficult |
Beta Was this translation helpful? Give feedback.
-
@mzfr I haven't found a way yet. |
Beta Was this translation helpful? Give feedback.
-
Any .css file is bundled, filenames can be changed no issue ! hugo-PaperMod/layouts/partials/head.html Lines 23 to 31 in 11c3230 |
Beta Was this translation helpful? Give feedback.
-
@adityatelange So I need to make a new css file in |
Beta Was this translation helpful? Give feedback.
-
when you'll put |
Beta Was this translation helpful? Give feedback.
-
@adityatelange I am sorry but I am still confused with the steps needed to modify the highlighting theme. Below I am listing what I understood please correct me if I am wrong:
Are these the right steps? If not can you please tell me the correct one Thanks a lot for your help :) |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
@adityatelange Thanks for the help. It is working now :) |
Beta Was this translation helpful? Give feedback.
-
@adityatelange I can get the custom syntax highlighting applied. However the There's no way that that we can get a syntax and background that match? |
Beta Was this translation helpful? Give feedback.
create
layouts/partials/extend_head.html
visit https://cdnjs.com/libraries/highlight.js/10.2.1
Select styling
You can see all the styling down below
click on copy link tag
Paste it in
layouts/partials/extend_head.html
Custom style loaded 🎉