Overriding parts of a theme VS the entire theme

I just stated playing with Hugo and I understand that you can use a theme and override parts of it, but you can also just copy the entire theme folder and change things there. Are there benefits to one over the other? (I am aware that if the theme updates then you wouldn’t get that benefit if you did it the latter method).

Kinda sounds like you answered your own question. You’d override a theme file using /layouts so that as updates are made to the original theme you could pull them into your project without overwriting anything that you’ve customized.

1 Like

Thanks @rhewitt I guess I’m asking because I’m kinda finding it confusing when I add files that will overwrite the files in the parent theme. My flow is this -> I want to change something, I find the file in the parent theme that has what I need to change, I copy that file to my layouts or static folder and change it. Now something isnt working right, so I have to find the file in the parent theme that is causing it, copy the file etc…
It seems like if I just copied the whole file (or changed the original theme folder) things may be easier to follow for me. I want to know best practices for such a thing. Like what would you do if you found yourself making lots of changes to a theme, just start from scratch?

It sounds to me like you’re doing everything correctly. AFAIK only a single template can act on a given piece of content. Is there a chance that you’re misunderstanding of which template is used for a given piece of content?

I personally haven’t worked with a theme before. I prefer to customize my design from the ground up.

I think it will be trial and error for me as I learn to tweak themes and understand how the templates are working on what, when I feel ready, I will roll my own for sure. I’m familiar with Jinja so I think I’m getting it. This, like everything else has a learning curve. Thanks again for your thoughts on this!

Change the theme directly only if you are certain that you’re never going to upgrade from the original. The advantage of changing by overriding in the layouts/ folder is that it is simpler to upgrade the theme since you haven’t changed any of its files directly.

1 Like