From 0da56daf5d7d0e6e20ce6e551cbe3a12b4af5eb4 Mon Sep 17 00:00:00 2001 From: curben <2809763-curben@users.noreply.gitlab.com> Date: Fri, 30 Aug 2019 11:20:40 +0100 Subject: [PATCH] fix(js): defer clipboard.min.js - https://stackoverflow.com/a/32413638 --- themes/typing/layout/_partial/after-footer.ejs | 2 +- themes/typing/layout/_partial/head.ejs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/typing/layout/_partial/after-footer.ejs b/themes/typing/layout/_partial/after-footer.ejs index 5338384..3876fed 100644 --- a/themes/typing/layout/_partial/after-footer.ejs +++ b/themes/typing/layout/_partial/after-footer.ejs @@ -1,5 +1,5 @@ <% 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 */%> diff --git a/themes/typing/layout/_partial/head.ejs b/themes/typing/layout/_partial/head.ejs index bc19041..80b8767 100644 --- a/themes/typing/layout/_partial/head.ejs +++ b/themes/typing/layout/_partial/head.ejs @@ -43,7 +43,7 @@ <%/* Fallback function for SRI */%> - <%- addJs('/js/sri.min.js') %> + <%- addJs({ src: '/js/sri.min.js', 'async': true }) %> <%- addCss('/css/typing.css') %>