I need syntax highlighting in Hugo. Currently use highlight.js. I like the final look, but not how it works. It uses javascript to run the lexer and apply styles. Instead I'd like do run the lexer during Hugo build phase so that the web site does not use javascript. Effectively I want to shorten page load time, and also eliminate the "blink" effect it takes to run the JS and apply styles. Open to suggestions. Thanks, Ruben
Hugo No-JS Syntax Highlight with highlight.js or prism.js
1.1k Views Asked by rubenhak At
1
There are 1 best solutions below
Related Questions in SYNTAX-HIGHLIGHTING
- In VScode, How to custom the PHP heredoc tag "HTML" to others?
- How to highlight comments in several different colors in CLion?
- To enable syntax highlighting with color for JBehave stories in Eclipse
- Implement Highlight.js in TextArea
- How do I turn off syntax highlighting in micro text editor?
- How to fix broken syntax highlight in Visual Studio 2022 UI (different colors)
- Visual Studio 2022 - Strange C++ Coloring/Highlighting
- syntax highlighting in Visual Studio 2022 in cshtml files not working
- Vscode shows fake import errors when saving a file | Java
- How to change background color of selected code
- treesitter/highlighter issues with LaTeX formula in Markdown files, and any other language
- C language server on Zed for SDL
- Vue 3.4 same-name shorthand vs-code support
- Syntax highlighting not applied to PascalCase-named files
- VScode Latex: Disable syntax highlighting for a range of lines
Related Questions in HUGO
- Why does Hugo generate different taxonomy-related HTML on different OS's?
- Audio player form url in html 5, hugo and netlify
- How can one create multiple distinct publication collections categorized by tags in the Hugo Academic CV Theme?
- Hugo website is being successfully deployed to github pages but it is not being served
- How do I set horizontal and vertical gutters in bootstrap 5 and Hugo?
- How can I create multiple nested menus (more level) in Hugo?
- Can we integrate Flutter pages into Hugo
- My Hugo blog's search isn't working. Not sure what needs to be done
- How to resolve 'error calling partial: partial "gallerydeluxe/head.html" not found '
- Escape { } in codeblock regions of a markdown file with Hugo
- Lazy loading Giscus on user interaction
- Custom 404 page when deploying static sites with Ionos Deploy Now, and HUGO server system
- CSS fix positioning of anchors next to details summary
- How to load data to generate data visualizations through Hugo shortcodes?
- Change blogdown rss template
Related Questions in STATIC-SITE
- KrakenD as a Proxy for Nginx Frontend
- Automatic dynamic header with Jekyll?
- 403 Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature
- NextJs 14- GenerateMetaData using static export
- wget converts fingerprints from ? into %3F
- Custom 404 page when deploying static sites with Ionos Deploy Now, and HUGO server system
- Failed to deploy Next.js site on GitHub Pages
- NextJS SST Static pages problem: Why static page get "Miss from CloudFront"?
- Reusable components using Tera/Zola
- Google Domains Github pages Enforce HTTPS — Unavailable for your site because your domain is not properly configured to support HTTPS
- Hugo add contact/about page that does not show as regular posts
- Querying Nested Params in Hugo
- How to include an admin area in a static site blog
- How can I setup my hugo url so I can list all desired urls under a certain URL path?
- Single Vercel build for multiple domains + languages using @nuxtjs/i18n and Storyblok
Related Questions in HIGHLIGHT.JS
- How to use marked-highlight from a VSCode extension?
- I can`t resolve problem with cursor focus in draft.js
- HTML written with Quill and Highlight.js in Next.js is not rendered properly
- On highlight an external file page load seems to fail
- highlight.js disappearing html meta tags
- Highlight markdown code in textarea (VueJS)
- I have some problem in @react-pdf-viewer/highlight in React jsx
- How to convert OpenAPI response example content to simple JSON ready for code highlighter?
- Highlight.js removing line breaks from core/code block after update
- Highlight.js not working with marked - returning TypeError: (e || "").toLowerCase is not a function
- How to create highlightjs plugin on nuxt3
- Vuejs3 HighlightJS not showing syntax
- Pug cannot find installed Highlight.js JSTransformer filter
- Using highlight.js in Figma plugin
- How can I syntax hightlight SASS with Javascript?
Related Questions in PRISM.JS
- Prism.js not work for xml language in nicegui
- Issue: Lack of Syntax Highlighting in TinyMCE CodeSample Plugin on Content Viewer and Internal Preview, while Visible in the Editor
- Refreshing string attribute (loaded from database) within prism.js textarea
- Writing html tags inside html
- Prism.js Disturbs Ajax?
- Highlight haskell file content using Prism.js
- Prism.js - How to get a link working in/with prism?
- How to highlight Java code at certain lines using prism.js
- Hugo No-JS Syntax Highlight with highlight.js or prism.js
- Can't update attribute line-number of prismjs when using with vuejs?
- Show HTML in WebView using Prism.js
- Reload PrimeJS highlighted code Angular app
- How to get syntax highlighting to work inside a text editor iframe? (JavaScript, CSS)
- Why does prism.js modify the DOM by inserting the language class into a surrounding <pre> tag?
- Angular - styles being ignored/overwritten
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Hugo uses chroma as a compile-time syntax highlighter, so you shouldn't need to use Highlight.js in Hugo.
From the Hugo page on syntax highlighting:
There are many style options (have a look at the chroma library) that you can set for the whole site or per code block.
The default highlight configuration in toml is: