instantpage / instant.page

Make your site’s pages instant in 1 minute and improve your conversion rate by 1%
https://instant.page
MIT License
6.01k stars 206 forks source link

Instant.page doesn't work well with Hugo #107

Closed Robin-Wils closed 2 years ago

Robin-Wils commented 2 years ago

Hugo uses pages like "mysite.com/about/" instant.page can't seem to handle that. Under that is a index.html. Open network tab of dev tools here, and see failed to load response data: https://www.robinwils.com/about/

Hugo is a pretty popular static website generator, so support for it would be cool.

Robin-Wils commented 2 years ago

image I implemented it like this. I took what was needed from the instant.page script for my own script. Previous link will no longer give those errors, because of this new code. I tried to understand the code, so that I could rewrite it from scratch.

coliff commented 2 years ago

heya @Robin-Wils - Instant.page works great with Hugo sites. I think you have something not setup correctly on your site. The links in the navbar are not ending with a / but the URLs which load when you click on them do. I'd suggest updating that to avoid HTTP redirects. You shouldn't need that code with ends with .html since your links don't have that anyway...

Robin-Wils commented 2 years ago

Thanks for the reply.

My custom logic has been working great since. I will probably just keep it, since it has been a while since I made that change. There was an error response I got at the time. Good that hugo is already supported though!