I have been spending far too long experimenting with Hugo themes. The list of attributes on the themes page is all very well, but how do I easily find, for example, if a theme:
- is currently maintained?
- has a sidebar?
- supports mathjax?
In fact possibly the top one is the most important: there are themes which although very handsome (at least, I think so), like Red Lounge, are old and don’t support new Hugo functionality. I find myself downloading a theme, setting it up to work with my blog, and then discovering that it is missing some attribute I’d like.
It’d be nice to be able to search all themes first, instead of downloading and testing. Is this at all possible?
Fair enough! Thanks - I’ll just continue with my explorations theme by theme then…
theme.toml file has a features array which could (should) allow your search (sidebar, mathjax):
If you have a unix like command line:
git clone --recurse-submodules https://github.com/gohugoio/hugoThemes.git
find hugoThemes/ -name theme.toml | xargs egrep -i 'sidebar|mathjax'
theme.toml files are not that verbose - here’s the output anyway:
$ find hugoThemes/ -name theme.toml | xargs egrep -i 'sidebar|mathjax'
hugoThemes/hugo-theme-foundation6/theme.toml:description = "A simple Hugo theme based on the Foundation v6 blog (sidebar) example."
hugoThemes/prologue/theme.toml:description = "Ported theme by HTML5 UP. Prologue is a single page responsive site template with a sticky sidebar."
hugoThemes/prologue/theme.toml:features = ["responsive", "sticky sidebar"]
hugoThemes/hurock/theme.toml:description = "A classic sidebar hugo theme"
hugoThemes/hurock/theme.toml:features = ["sidebar", "TableOfContents", "highlight", "404"]
theme.toml you can:
find hugoThemes/ -type f | egrep -i 'sidebar|mathjax.js'
which gives 86 hits. minimo has both.
As it comes to the currently maintained search:
https://themes.gohugo.io lists the themes sorted by last update date (before the last hugoThemes update)
You can check yourself e.g. via:
for theme in $(find hugoThemes/ -name .git); do git --git-dir=$theme log --pretty=format:"%aI $theme %n" -n1; done | sort -n | egrep '^2018'
~~~ cut ~~~
minimo shows up again
Thank you very much - that looks as though it will work very well. However, I have discovered that Blackburn supports a sidebar and mathjax, as well as being an elegant and simple layout. Currently it’s my theme of choice.