Overview:
Currently my blog is hosted on a separate Github repo from the rest of my main website.
To put a link from the blog back to my main website I decided to modify the footer layout from the HugoTex theme. I wanted to make the change without directly modifying the original theme files.
Solution: Hugo searches for files in the layouts/
folder before using the files from the
theme’s layouts/
folder.
Reference page: Hugo: Customizing a theme
Steps:
- Look in the
themes/<theme name>/layouts
directory to find the theme file you want to modify. - Copy the file to your root
layouts/
directory, matching the directory structure that the original file is in. For example:- Theme file:
themes/HugoTex/layouts/partials/footer.html
- Is copied to:
layouts/partials/footer.html
- Theme file:
- Now modify the copied file to make your changes.