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
- Sublimetext 3 & AngularJS - Syntax highlighting (HTML)
- IntelliJ IDEA - Syntax Highlighting of SQL Inside Java Code
- Javascript syntax highlighter infinite loop
- How to add your own syntax to Sublime Text 2
- VS 2010 no longer underlines errors for VB.NET
- Set language for syntax highlighting in Visual Studio Code
- Display Github repository files directly in a blog
- Is it possible to highlight ObjC code in Intellij IDEA?
- How do I remove a duplicated Syntax highlight option?
- angular.js syntax highlighting colors in IDEA / WebStorm editor
- PhpStorm - wrong syntax highlighting with Blade
- Merging two syntax highlighters in SublimeText
- Pandoc: What are the available syntax highlighters?
- Underscore breaking HTML syntax highlighting in PyCharm
- How to highlight dynamic property invocation in PhpStorm in a different color than?
Related Questions in HUGO
- Hugo not reading .Rmd files after using blogdown
- How to create a page to render permalink in Hugo
- How to create working Breadcrumbs for Hugo?
- Relative image paths for Twitter cards in blogdown
- In a Hugo partial template, how do I access secondary/additional parameters?
- Blogdown posts appearing in RStudio but not on Github Pages
- Is there an easy way to add a summary under the headline to the home page in a blogdown theme?
- blogdown + hugo, tabbed codeblock doesn't show up with theme tranquilpeak
- Difficulty using new_post in blogdown
- Image via shortcode in RMarkdown using blogdown not showing up
- Cannot link to static files with Hugo
- How are searches implemented in a Flat File CMS
- Blogdown: Deploy with Netlify fails with standard theme
- Google Analytics does not work with blogdown
- Create a table of contents (toc) in a post with blogdown package
Related Questions in STATIC-SITE
- middleman blog at /blog with already made static site?
- jQuery – Loading random images from directory
- Django internationalization for static website
- How to serve a local website (i.e. file://) from OS X to mobile devices?
- A static blog generator with multiple image directories
- Duplicate items appearing in shopping cart
- How to create a page to render permalink in Hugo
- Static website with microservices?
- Are there any static site generators that can publish github wikis?
- How to use Vue.js in Hexo (static site generator)?
- Jekyll multiple post types
- AWS S3 Bucket Redirection redirects to a malformed URL
- Does it make sense to use memcache with a static site?
- How to add a favicon to a website built with the Publish static site generator?
- Browser window scrolling/focusing on #section-link in Jekyll static site
Related Questions in HIGHLIGHT.JS
- Maintain Markup Format with Highlight.js
- How to set code syntax highlight using angular-marked
- How can I correctly highlight a line by line code, using highlight.js (React)?
- Highlight code with Markdown-it.js and Highlight.js
- How to apply Highlight.js to new views using Ember.js?
- How to change the theme and language of syntax highlighting in reveal.js
- 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 markdown code in textarea (VueJS)
- highlight.js disappearing html meta tags
- Highlight symbols and numbers with Highlight.js
- Wierd font change when adding highlightjs to Hugo website using blowdown and Anatole theme
- Display Python code on a webpage using highlight.js and jquery
- Problem span class when edit data on jqgrid and jquery highlight
- Highlight js applies classes but not styles
Related Questions in PRISM.JS
- Prism.js TypeError: element.className is undefined
- Prism.js not work for xml language in nicegui
- Use PrismJS with RequireJS, even though it's not a dependency
- Prism.js not working with Rails 4 turbolinks
- How to get syntax highlighting to work inside a text editor iframe? (JavaScript, CSS)
- Output HTML as plain text for code example
- Prism.js - How to get a link working in/with prism?
- Prism.js Disturbs Ajax?
- Prism HTML highlighter
- Can't update attribute line-number of prismjs when using with vuejs?
- Hugo No-JS Syntax Highlight with highlight.js or prism.js
- How to highlight code samples through AngularJS using Prismjs and TinyMCE
- Writing html tags inside html
- TinyMCE strips own codesample
- Client-side Prism.js with npm
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 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: