Skip to main content

Override a Hugo theme

Published: 2019-01-20 | Lastmod: 2019-09-12

We've all been there. You're browsing through the Hugo themes and find one that you really like. It meets all your criteria, except for that one small thing. So, what are your options?

Well, thanks to Hugo's lookup order, you can override any part of a theme that you want. The following is a quick example.

Let's say you really like theme foo, but you wish the homepage was different. All you have to do is copy the homepage template:

your-site/themes/foo/layouts/index.html

And paste it under your own layouts folder:

your-site/layouts/index.html

Then you're free to make any changes you want to the homepage. When Hugo builds your site, your copy of index.html will be used instead of the theme's index.html.