hugo-future-imperfect
hugo-future-imperfect copied to clipboard
Fix unneeded highlight CSS, fix disable_highlight, clean up highlight template
Description
Use default values of "github" for theme and 9.12.0 for version. Allow highlights to be disabled globally or per page.
Motivation and Context
Closes #131.
How Has This Been Tested?
Tested manually.
Hugo Version: 0.37.1
Browser(s): Chrome
Screenshots (if appropriate):
Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation, including
theme.toml
, accordingly. - [x] I have read the Contributing Document.
There is an extra call to hljs.initHighlightingOnLoad
near the bottom of footer.html
that should be removed because it will fail with disable_highlight
.
I didn't see that. I'll make the change and update the PR.
One more thing I noticed is that bootcss CDN doesn't work for me anymore. I have to use cloudflare instead.
Fixed. Although I realized shortly after making this originally, hugo has builtin syntax highlighting. So is this really necessary?
@lfkeitel Good point. I don't know that. Does the built-in syntax highlight support source code in my posts (md files)? If so, I agree we'd better use the built-in one.
@hjiawei yea: https://gohugo.io/content-management/syntax-highlighting/. It uses shortcodes to mark code sections. You can even highlight specific lines for emphasis. You can set a theme and use inline styles or a separate style sheet that hugo can generate for you. It's very powerful. Most importantly, it removes any runtime Javascript for the highlighting since it's all pre-processed.