diff --git a/scripts/filters/locals.js b/scripts/filters/locals.js index 67bd121..44a5a2e 100644 --- a/scripts/filters/locals.js +++ b/scripts/filters/locals.js @@ -18,6 +18,7 @@ hexo.extend.filter.register('template_locals', locals => { locals.description = __('description') !== 'description' ? __('description') : config.description; locals.languages = [...i18n.languages]; locals.languages.splice(locals.languages.indexOf('default'), 1); + // See https://github.com/hexojs/hexo/pull/4614 page.lang = page.lang || page.language; // Creative Commons locals.ccURL = 'https://creativecommons.org/' + (theme.creative_commons.license === 'zero' ? 'publicdomain/zero/1.0/' : 'licenses/' + theme.creative_commons.license + '/4.0/') + (theme.creative_commons.language || ''); diff --git a/source/js/utils.js b/source/js/utils.js index e451f64..4f542f6 100644 --- a/source/js/utils.js +++ b/source/js/utils.js @@ -86,6 +86,7 @@ NexT.utils = { const lines = element.querySelector('.code') || element.querySelector('code'); const code = lines.innerText; if (navigator.clipboard) { + // https://caniuse.com/mdn-api_clipboard_writetext navigator.clipboard.writeText(code).then(() => { button.querySelector('i').className = 'fa fa-check-circle fa-fw'; }, () => {