{"action":"created","issue":{"url":"https://api.github.com/repos/hexojs/hexo/issues/3017","repository_url":"https://api.github.com/repos/hexojs/hexo","labels_url":"https://api.github.com/repos/hexojs/hexo/issues/3017/labels{/name}","comments_url":"https://api.github.com/repos/hexojs/hexo/issues/3017/comments","events_url":"https://api.github.com/repos/hexojs/hexo/issues/3017/events","html_url":"https://github.com/hexojs/hexo/issues/3017","id":295577888,"number":3017,"title":"Defer parsing of JavaScript, how to do with Hexo?","user":{"login":"MrBRUE","id":16508636,"avatar_url":"https://avatars1.githubusercontent.com/u/16508636?v=4","gravatar_id":"","url":"https://api.github.com/users/MrBRUE","html_url":"https://github.com/MrBRUE","followers_url":"https://api.github.com/users/MrBRUE/followers","following_url":"https://api.github.com/users/MrBRUE/following{/other_user}","gists_url":"https://api.github.com/users/MrBRUE/gists{/gist_id}","starred_url":"https://api.github.com/users/MrBRUE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrBRUE/subscriptions","organizations_url":"https://api.github.com/users/MrBRUE/orgs","repos_url":"https://api.github.com/users/MrBRUE/repos","events_url":"https://api.github.com/users/MrBRUE/events{/privacy}","received_events_url":"https://api.github.com/users/MrBRUE/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-08T16:28:19Z","updated_at":"2018-02-08T21:55:28Z","closed_at":null,"author_association":"NONE","body":"Hi, I have decently optimized my static Hexo site. However there is still a lot of JavaScript being loaded during initial page load.  Found that out by putting it through gtmetrix.com.\r\n\r\nSo question is, is there a module or a property I can use to defer loading of scripts that are not crucial for initial page load? I can see scripts like this being loaded early on:\r\njs/lg-autoplay.min.js\r\njs/query.justifiedGallery.min.js \r\n\r\nAnd so on. Scripts that are not even critical for the view.\r\n\r\nThanks for any advice!\r\n"},"comment":{"url":"https://api.github.com/repos/hexojs/hexo/issues/comments/364261433","html_url":"https://github.com/hexojs/hexo/issues/3017#issuecomment-364261433","issue_url":"https://api.github.com/repos/hexojs/hexo/issues/3017","id":364261433,"user":{"login":"tcrowe","id":1634015,"avatar_url":"https://avatars2.githubusercontent.com/u/1634015?v=4","gravatar_id":"","url":"https://api.github.com/users/tcrowe","html_url":"https://github.com/tcrowe","followers_url":"https://api.github.com/users/tcrowe/followers","following_url":"https://api.github.com/users/tcrowe/following{/other_user}","gists_url":"https://api.github.com/users/tcrowe/gists{/gist_id}","starred_url":"https://api.github.com/users/tcrowe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tcrowe/subscriptions","organizations_url":"https://api.github.com/users/tcrowe/orgs","repos_url":"https://api.github.com/users/tcrowe/repos","events_url":"https://api.github.com/users/tcrowe/events{/privacy}","received_events_url":"https://api.github.com/users/tcrowe/received_events","type":"User","site_admin":false},"created_at":"2018-02-08T21:55:28Z","updated_at":"2018-02-08T21:55:28Z","author_association":"NONE","body":"Hi @MrBRUE 👋 \r\n\r\nEach theme can load scripts a certain way or a helper like this: https://hexo.io/api/helper.html#Example\r\n\r\nAnother thing you can try is adding `defer` or `async` attributes to the scripts. https://www.w3schools.com/tags/att_script_defer.asp\r\n\r\nAnother common thing people need is `skip_render` to prevent their custom scripts from being rendered through hexo. https://www.w3schools.com/tags/att_script_defer.asp\r\n\r\nIf that helps you get to your solution can you let me know and/or close out the issue?"}}
{"actor":{"display_login":"tcrowe"}}