This is a simple, responsive blog theme for Hugo based on Lithium. Hugo Natrium was created by Tim (mobybit). This fork of the theme is actively maintained (for new Hugo version compatibility) by myself.
Changes have been introduced to make this theme compatible with the latest Hugo versions (0.53 and newer).
-These changes break the theme in older Hugo versions (0.52 and prior).
Upgrading to at least Hugo 0.53 is required to maintain functionality. The changes include:
- Replace instances of .URL with .RelPermalink (fixes "WARN Page.URL is deprecated and will be removed in a future release. Use .Permalink or .RelPermalink.")
- Replace instances of .Hugo with hugo (fixes "WARN Page.Hugo is deprecated and will be removed in a future release. Use the global hugo function.")
- Replace instances of .RSSLink with .OutputFormats.Get "RSS" (fixes: "WARN Page.RSSLink is deprecated and will be removed in a future release. Use the Output Format's link.")
- Replace instances of .Data.Pages with .Site.RegularPages (fixes "Error <.Paginate>: error calling Paginate: cannot convert type page.PagesGroup to Pages")
-To use Natrium with older versions of Hugo (0.25 - 0.52), -use the previous commit from mobybit
Natrium includes: taxonomies (categories, tags), static footer, new fonts (Roboto Mono, Font Awesome), local fonts, comments (Disqus), syntax highlighting, better support for code, img and RSS, pagination, multiple design optimizations, i18n, 404.html...
- Disqus (comments)
- Privacy (no Google)
- Syntax highlighting
Run the following inside your Hugo site folder:
$ mkdir themes $ cd themes $ git clone https://github.com/mobybit/hugo-natrium-theme
Used for blog posts. Blog posts are listed on the homepage.
hugo new post/<post-name>.md to create a post.
Used for site pages.
hugo new page/<page-name>.md to create a page.
Natrium is using Chroma and
pygmentsStyle = "native" by default. If you would like to use another style you have to adjust the colors in
pre in main.css.
exampleSite\exampleSite.Tests.ps1 contains basic PowerShell Pester tests that I use to validate this theme as new Hugo versions are released. To run the tests, you will need Pester 5+:
Install-Module -Name Pester -Force -SkipPublisherCheck
Once installed, the Pester tests can be invoked as follows:
cd <path-to-theme>\exampleSite invoke-pester -Output Detailed
The code is available under the MIT License.
Other used fonts are Merriweather by Sorkin Type (Copyright © 2016 The Merriweather Project, SIL OFL 1.1), Lato by Łukasz Dziedzic (Copyright © 2010-2014 by tyPoland Lukasz Dziedzic, SIL OFL 1.1) and Roboto Mono by Christian Robertson (Copyright © 2015 Google Inc., Apache License 2.0).
Special thanks to Artem Sidorenko (tag cloud).