~~Windows can't use docsy-jekyll~~ jquery can't be loaded in China
puppylpg opened this issue · 12 comments
Hi,
Thanks for docsy-jekyll.
I run it on Windows Subsystem Linux, and it works. However when I open the website by chrome, the response is too slow to bare. At the same time, toc in the right sidebar doesn't appear. When I run it on Linux, everything is ok. So I thought it may be caused by WSL.
Interesting thing happens: I deploy it to github pages, then the same problem arises when visiting using Windows chrome(slow & no toc in the right sidebar). At the same time, vising using Linux chrome is totally ok.
Any idea what happens?
Thanks in advance.
I don’t use Windows so I can’t debug nor do I have an idea. But I’d suggest testing other Jekyll sites, if others are slow it’s likely a Windows Jekyll issue. You could also look in the browser console for warnings. Anyway if you do figure out the issue please contribute a PR to fix!
Oh, and I’ll also check to see if standard docsy (deployed with Hugo) is also slow for you. It’s just a static site, so I’m not sure what Windows is having trouble with... perhaps look at the networking box in the browser console and figure out what specifically is causing the slowness?
I don’t use Windows so I can’t debug nor do I have an idea. But I’d suggest testing other Jekyll sites, if others are slow it’s likely a Windows Jekyll issue. You could also look in the browser console for warnings. Anyway if you do figure out the issue please contribute a PR to fix!
Other jekyll theme is ok because I use jekyll theme minima before, everything is ok.
I don’t use Windows so I can’t debug nor do I have an idea. But I’d suggest testing other Jekyll sites, if others are slow it’s likely a Windows Jekyll issue. You could also look in the browser console for warnings. Anyway if you do figure out the issue please contribute a PR to fix!
Other jekyll theme is ok because I use jekyll theme minima before, everything is ok.
Thanks for your advice, I check it using browser network consule, and it seems that jquery-3.3.1.min.js cannot be loaded(it's red in the network console. I'm not familiar with website, but thought it may be the reason). I'll try to find more, thanks
Sorry to bother. It's exactly I can't visit https://code.jquery.com/jquery-3.3.1.min.js
in my home(and using windows...). Try to download a jquery locally may solve the problem.
And thanks for your help
Are you in China? I think various Google CDNs (and others) are blocked there? https://forum.jquery.com/topic/cannot-connect-to-google-cdn-from-china Really sorry :(
Are you in China? I think various Google CDNs (and others) are blocked there? https://forum.jquery.com/topic/cannot-connect-to-google-cdn-from-china Really sorry :(
:D hahaha yeah, that's awkward. Anyways, thanks for your patience. I'll try a China jquery CDN or download jquery directly to use.
Sounds good, let me know how it goes! If you find one that works, let's add a note to the documentation for future users that might run into this issue.
Here is what I do:
- download jquery and put it into
assets/js
, akaassets/js/jquery-3.3.1/jquery-3.3.1.js
andassets/js/jquery-3.3.1/jquery-3.3.1.min.js
; - find the places where jquery are used in project root:
grep -r "https://code.jquery.com/jquery-3.3.1.min.js" . --exclude-dir=_site
. they are_include/head.html
and_include/toc.html
; - replace
src="https://code.jquery.com/jquery-3.3.1.min.js"
withsrc="{{ site.baseurl }}/assets/js/jquery-3.3.1/jquery-3.3.1.min.js"
;
Everything works.