noJS Hugo theme
A minimal, no-JavaScript theme for the Hugo static site generator. Check out the Git repository at git.andy.sb/nojs.
Features #
- no JavaScript
- dark mode via
prefers-color-scheme - syntax highlighting
- LaTeX via
transform.ToMath
Installation #
For more information read the official quick start guide of Hugo.
In your themes/ directory, run:
git clone https://git.andy.sb/nojs.git
Set the theme in hugo.toml at the base of the Hugo site:
theme = "nojs"
Add menu entries:
[menus]
[[menus.main]]
name = 'Home'
pageRef = '/'
weight = 1
[[menus.main]]
name = 'Posts'
pageRef = '/posts'
weight = 2
[[menus.main]]
name = 'Tags'
pageRef = '/tags'
weight = 3
Image captions #
You can add captions to images (technically using <figcaption> HTML tags) by adding titles, like so:

Syntax highlighting #
Disable noClasses to use this modified algol_nu theme.
[markup]
[markup.highlight]
noClasses = false
LaTeX via transform.ToMath #
Instead of client-side JavaScript rendering of mathematical markup using MathJax or KaTeX, use this passthrough render hook which calls the transform.ToMath function.
[markup]
[markup.goldmark]
[markup.goldmark.extensions]
[markup.goldmark.extensions.passthrough]
enable = true
[markup.goldmark.extensions.passthrough.delimiters]
block = [['\[', '\]'], ['$$', '$$']]
inline = [['\(', '\)']]
Now add some mathematical markup to your content.
Calculate the cohomology \(H^n(C;G)\) using the _universal coefficient theorem_:
\[H^n(C;G) \cong \operatorname{Ext}(H_{n-1}(C),G) \oplus \operatorname{Hom}(H_n(C),G)\]
Calculate the cohomology using the universal coefficient theorem:
Note that the external katex.css is loaded in the head.html partial.