Update docs

This commit is contained in:
Mimi 2021-01-30 15:31:43 +08:00
parent 641c310554
commit 51ef7217a1
2 changed files with 2 additions and 0 deletions

View File

@ -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 || '');

View File

@ -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';
}, () => {