StefMa / hugo-fresh

Hugo Fresh Theme
https://hugo-fresh.vercel.app
MIT License
588 stars 337 forks source link

edit the theme files #173

Closed mansoorbarri closed 1 year ago

mansoorbarri commented 1 year ago

Is there a way to edit the themes files like a normal Hugo theme which has all the files in themes/ directory?

Sorry, this may seem a bit dumb but i'm new to the hugo modules and stuff.

StefMa commented 1 year ago

Hi and thanks for the answer.

Hugo has a special lookup order: https://gohugo.io/templates/lookup-order/

What does this mean? In general, doesn't matter if you use a theme via git submodules or as a go module, you shouldn't edit files from themes. Instead, you should override those!

How to override? Simply put the edited files to the exact same position as the theme has the origin file, but in your personal Hugo project.

Example: The Hugo project has the default favicon in static/images. How to override? Create a static/images/favicon in your Hugo project. That's it! Same applied for literally anything. Also for layouts and stuff...

I hope this helps a bit and you now you know how to change the theme to your needs ☺. If not, don't hesitate to ask again.