Comments (2)
I was hoping to get help by asking a question but no one was able to help in 27 days.
This problem is fairly easy to reproduce:
- Create a new hugo site.
- Install
hugo-future-imperfect-slim
theme. - Copy
themes\hugo-future-imperfect-slim\exampleSite
to the root of the new site. - Configure config.toml to show hightlights as the following:
[markup]
[markup.highlight]
anchorLineNos = false
codeFences = true
guessSyntax = false
hl_Lines = ''
lineAnchors = ''
lineNoStart = 1
lineNos = true
lineNumbersInTable = false
noClasses = false
#style = 'monokai' # This field is not required when noClasses == false.
tabWidth = 2
- Genereate a monokai css theme with the command
hugo gen chromastyles --style=monokai>static\css\syntax.css
as per Hugo's syntax highlighting. - Add the new css file to cssFiles in your config file. Locate the line
cssFiles
in section[params]
in your config.toml and change it for the following:cssFiles = ["default", "css/syntax.css"]
.
The code fences will keep their white background and the syntax highlighting will not be as per the monokai theme.
from hugo-future-imperfect-slim.
I was able to investigate and track down the problem. This problem is not related to hugo but is actually specific to this theme. For example, if you configure another theme, the code sections are properly rendered. I think it is because this theme insert css classes in highlighted code which overrides [markup.highlight]
settings.
More specifically, the css classes hljs
and hljs-subst
and the css for pre code
and code
are interfering with Hugo's build-in highlighting classes.
I was able to partially workaround the problem by overriding some files of the theme. For example, I created the following 2 blank files:
- assets\css\dark.css
- assets\css\default.css
These file were empty which prevented my site to define hljs
and hljs-subst
classes.
A better fix would be to not generate HTML with the hljs
and hljs-subst
classes. I think there is probably a template somewhere in the theme's code that actually handles this. I may have to override it but I was not able to track which template file handles highlighting.
I am still looking for help in order to tackle this problem and get a better fix. Any help is appreciated.
from hugo-future-imperfect-slim.
Related Issues (20)
- FEATURE: Full Twitter Cards markup support HOT 1
- BUG: article tags organization doesn't conform to w3c standard
- BUG: Staticman reply to functionality broken
- BUG: Use https
- BUG: Search dont work under some circumstances HOT 5
- BUG: Manage the menu HOT 6
- HELP: Setting an image in blog HOT 10
- FEATURE: user-header.js and user-footer.js HOT 2
- BUG: missing demo site's top bar translations for some languages HOT 2
- FEATURE: Tile Layout HOT 4
- QUESTION: Build fails on Netlify but works locally HOT 1
- QUESTION: Make homepage /"Home"-link to static site HOT 2
- QUESTION: Search function only works locally HOT 2
- BUG: readme.md link to live demo is broken HOT 1
- BUG: Contact Form - exampleSite emailservice & Formspree link confusion HOT 1
- QUESTION: Does webhook work with GitHub App for Staticman
- BUG: failed to render pages
- BUG: search option in top menu gives error: Error loading search results...
- NOTICE: Theme is no longer maintained. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hugo-future-imperfect-slim.