Static Header and Footer for Hugo?

Is it possible to create a static header and footer for Hugo? So when I go to another page, the header and footer do not load again. Just the page content change…

you really need this ~0.x ms??

You end with a more complex structure - mostly slower :wink:

@somratpro may be you can look at

And Bep have a Hugo module for using this :

1 Like

You could render the content without header and footer and use Vue or any other library to load the content dynamically. Things you will have to add to your whole setup: ways to fall back on for people with a Javascript allergy, properly updating the URL to be unique for each unique content particle, SEO…

Technically speaking, if you use particalCached for your header and footer (not the navigation part if you show “current” page items differently styled) it will build fast and load fast, but in the end it will load header/footer again each time you load a page.

In the end, what you are trying is to use a STATIC site generator to create DYNAMIC websites. It’s possible. But people on the street will give you looks.



can you tell me how to do it?

checkout _default/baseof.html and replace Partial with partialCached for your header and footer

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.