UNPKG

hexo-theme-essence

Version:

A Simple Clean Theme for Hexo with user-friendly Navigation System.

17 lines (11 loc) 493 B
/* global hexo */ 'use strict'; const { htmlTag } = require('hexo-util'); function detailsTag (args, content) { args = args.join(' ').split('@'); const isOpen = args[0].trim() ? true : null; const summary = (args[1] || 'Details').trim(); const str = hexo.render.renderSync({ text: content, engine: 'markdown' }); return htmlTag('details', { open: isOpen }, htmlTag('summary', {}, summary, false) + str, false); } hexo.extend.tag.register('details', detailsTag, { ends: true });