docsifyjs / docsify

🃏 A magical documentation site generator.
https://docsify.js.org
MIT License
27.8k stars 5.68k forks source link

How remove live reload? #588

Closed patrickboulay closed 6 years ago

patrickboulay commented 6 years ago

Is there an option to deactivate the live reload?

Thanks

SidVal commented 6 years ago

Excuse me, what is live reload? Give me an example 😐

patrickboulay commented 6 years ago

If you open your doc in a browser and you modify the .md files, you will see your web page automatically updated.

Also, if you display the source code of the web page, you will see this line at the end:

<script src="//10.2.3.19:35729/livereload.js?snipver=1" async="" defer=""></script></body>

There is an openned connection on port 35729 waiting for an update of the documentation. You can also specify the reload port using the argument -P, ex: -P 35730

I dont need this feature.

SidVal commented 6 years ago

Well, I didn't know that. Sorry.

Please @QingWei-Li, can you give us a ✋ here, please?

jingsam commented 6 years ago

You can use http-server instead of docsify serve. Note that you should run npm install http-server -g first.

iluhavlg commented 1 year ago

I need to do the same thing. Now i got an error GET https://MYURL:35729/livereload.js?snipver=1 net::ERR_CONNECTION_TIMED_OUT and the page spins the loader a while until the error occurs

hhtower commented 1 year ago

how can i delete livereload ? use docsify-cli 4.4.4. when docsify server, then visit, and throw strict-origin-when-cross-origin. so I want to delete it.

GaoFeiGit commented 9 months ago

Modify this file

{NODE_HOME}\node_modules\docsify-cli\node_modules\connect-livereload\index.js

  1. Find snippet method
    function snippet(host) {
    var src = opt.src || '//' + host + ':' + port + '/livereload.js?snipver=1';
    return [src].concat(plugins).map(function(source) {
      return '<script src="' + source + '" async="" defer=""></script>';
    }).join('');
    }
  2. Modify snippet method
    function snippet(host) {
    var src = opt.src || '//' + host + ':' + port + '/livereload.js?snipver=1';
    return [src].concat(plugins).map(function(source) {
      return '';
    }).join('');
    }

    Done!