- HTML 58.4%
- CSS 41.6%
| archetypes | ||
| assets | ||
| images | ||
| layouts | ||
| hugo.toml | ||
| LICENSE | ||
| nojs.svg | ||
| README.md | ||
| theme.toml | ||
noJS Hugo theme
A minimal, no-JavaScript theme for the Hugo static site generator. Check out the demo at nojs.andy.sb.
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
RSS feed
The theme ships a custom rss.xml that emits full post content in
<content:encoded> (not just a teaser). Two site-level options control it:
ShowFullTextinRSS = true # top-level site config, not under [params]
[params]
# limit feed items to posts published within this many months
# (0 or unset = no age limit)
rss_max_age_months = 6
Hugo's built-in [services.rss] limit config (item count) is still honored
and combines with the age limit above — whichever is more restrictive wins.
By default the root/home feed (/index.xml) is built from every regular
page on the site, across all sections. To instead source it from a single
section (e.g. only content/blog), set:
[params]
rss_section = "blog"
The root feed still lives at /index.xml; this only changes which pages
populate it. Section feeds (e.g. /blog/index.xml) are unaffected and
always reflect their own section.
A <link rel="alternate" type="application/rss+xml"> tag pointing at the
root feed is emitted in <head> automatically for browser/reader
autodiscovery.
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)\]
Note that the external katex.css is loaded in the head.html partial.
Extra Options
Opt-in prev/next entry navigation. A section enables this by setting
enable_prev_next: true in its _index.md front matter.
