'use strict' /* global hexo */ /* * Helper to embed css file with support of custom attributes * https://github.com/hexojs/hexo/pull/3690 */ hexo.extend.helper.register('addCss', (...args) => { let result = '\n' let items = args if (!Array.isArray(args)) { items = [args] } items.forEach(item => { // Old syntax if (typeof item === 'string' || item instanceof String) { result += `\n` } else { // New syntax let tmpResult = ' { tmpResult += ` ${attribute}="${item[attribute]}"` }) tmpResult += '>\n' result += tmpResult } }) return result })