fix(js): defer clipboard.min.js

- https://stackoverflow.com/a/32413638
This commit is contained in:
curben 2019-08-30 11:20:40 +01:00
parent 2cde665dbb
commit 0da56daf5d
No known key found for this signature in database
GPG Key ID: 5D9DB57A25D34EE3
2 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,5 @@
<% if (is_post()) { %> <% if (is_post()) { %>
<%- addJs({ src: 'https://cdn.statically.io/libs/clipboard.js/2.0.4/clipboard.min.js', 'data-sri-fallback': '/js/clipboard.min.js', integrity: 'sha384-8CYhPwYlLELodlcQV713V9ZikA3DlCVaXFDpjHfP8Z36gpddf/Vrt47XmKDsCttu', crossorigin: 'anonymous'}) %> <%- addJs({ src: 'https://cdn.statically.io/libs/clipboard.js/2.0.4/clipboard.min.js', 'data-sri-fallback': '/js/clipboard.min.js', integrity: 'sha384-8CYhPwYlLELodlcQV713V9ZikA3DlCVaXFDpjHfP8Z36gpddf/Vrt47XmKDsCttu', crossorigin: 'anonymous', defer: true}) %>
<% } %> <% } %>
<%/* javascript of Typing theme */%> <%/* javascript of Typing theme */%>

View File

@ -43,7 +43,7 @@
<link rel="sitemap" type="application/xml" title="Sitemap" href="/sitemap.xml"> <link rel="sitemap" type="application/xml" title="Sitemap" href="/sitemap.xml">
<%/* Fallback function for SRI */%> <%/* Fallback function for SRI */%>
<%- addJs('/js/sri.min.js') %> <%- addJs({ src: '/js/sri.min.js', 'async': true }) %>
<%- addCss('/css/typing.css') %> <%- addCss('/css/typing.css') %>