partialCached nav keeps refreshing

When I navigate to different pages, the partialCached navbar keeps refreshing.

I have tried floats, flexbox, and grid, but I still can’t make it work. Caching images in netlify didn’t help either. Unfortunately, I am required to use multiple images in the navbar…

It is possible that I don’t fully understand how partialCached and baseof template work, but it was my understanding that it was possible to make it work similarly to AJAX or React, i.e, when you navigate to different paged the navbar does not reload.

I have looked at different themes, but I haven’t been able to find a solution. Plus, I’m not a huge fan of themes anyway.

You see a sample layout here: https://github.com/ihodson/hugo
and the live version here: https://partialcached-example.netlify.app/

When you navigate to different pages, the locally stored images keep refreshing, but surprisingly, a much larger pexels image doesn’t…

Your help is much appreciated!

Hugo is a static site generator. It outputs HTML and assets. Hugo is not a framework that provides out-of-the-box AJAX-like or Turbolinks-like functionality. You have to do that yourself.

partialCached refers to the caching of a partial template when the project’s HTML is published with the command hugo. It does not work like a JS-like script that runs in the browser.

2 Likes