mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-26 05:30:54 +03:00
parent
4b0c194fb3
commit
d337619a01
2 changed files with 21 additions and 7 deletions
|
@ -31,4 +31,18 @@ HugoReload.prototype.reload = function (path, options) {
|
|||
return true;
|
||||
};
|
||||
|
||||
LiveReload.addPlugin(HugoReload);
|
||||
(function () {
|
||||
LiveReload.addPlugin(HugoReload);
|
||||
|
||||
// Close the WebSocket connection when the user leaves.
|
||||
window.addEventListener('pagehide', () => {
|
||||
console.log('Disconnecting LiveReload');
|
||||
LiveReload.connector.disconnect();
|
||||
});
|
||||
|
||||
// Open the connection when the page is loaded or restored from bfcache.
|
||||
window.addEventListener('pageshow', () => {
|
||||
console.log('Connecting LiveReload');
|
||||
LiveReload.connector.connect();
|
||||
});
|
||||
})();
|
||||
|
|
12
livereload/livereload.min.js
vendored
12
livereload/livereload.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue