-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Livereload CSS and images without browser refresh #490
Conversation
This would be great. The JS library I used doesn't support it, but I'd love to add this feature. It would be trivial on the GO side, it's the JS that I think would be hard. Any Javascript wizards want to add this? |
Just a note:
|
Seems like the JS library in use supports soft reloading just fine. If I change the hardcoded
To another hardoced value that matches the file I'm changing:
Then it only loads the CSS and not the whole page. I might have a look at this - but even if I'm an experienced developer, this Go is a blank page. I guess one would have to
|
Prior to this commit a dummy JavaScript filename was sent to LiveReload when changing a static file (CSS, image etc.), forcing a full browser reload of the page. This commit fixes this by sending the relative file path of the changed static resource, enabling partial live reloading for CSS- and image-changes. If more than one static file happens to end up in the same changeevent-batch, it will fall back to do a full refresh. To enable this logic, the change events with names ending with ".goutputstream*" is now filtered out as temporary. Changes in dynamic content behaves like before. Issue gohugoio#490
Added a fix for this. Works very nice on my site. I opted not to add any configuration options to turn this on/off. I read in another thread that you consider changing the license for this project so I might just put here that I'm OK with any license (if you pull in my changes). |
Prior to this commit a dummy JavaScript filename was sent to LiveReload when changing a static file (CSS, image etc.), forcing a full browser reload of the page. This commit fixes this by sending the relative file path of the changed static resource, enabling partial live reloading for CSS- and image-changes. If more than one static file happens to end up in the same changeevent-batch, it will fall back to do a full refresh. To enable this logic, the change events with names ending with ".goutputstream*" is now filtered out as temporary. Changes in dynamic content behaves like before. Issue #490
Thanks for the contribution. This is great. Merged as df489b4 |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Not sure if this is as-designed or not, but it's stated in the documentation that Hugo may not be the first static site generator to utilize live reload technology, but it’s the first to do it right so I create this issue:
If your normal work flow is writing articles, then this isn't a real issue - but for pixel tweeking in CSS there is a big difference.