From efc1966f1b976a0c59ef5b08da41838bda0e7a83 Mon Sep 17 00:00:00 2001 From: cysn <92655031+Fgaoxing@users.noreply.github.com> Date: Mon, 11 Jul 2022 05:46:52 +0800 Subject: [PATCH] feat(tag): add pandown (#785) --- scripts/tags/pandown.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 scripts/tags/pandown.js diff --git a/scripts/tags/pandown.js b/scripts/tags/pandown.js new file mode 100644 index 000000000..2d63e8732 --- /dev/null +++ b/scripts/tags/pandown.js @@ -0,0 +1,33 @@ +'use strict'; + +// {% pandown type, url, pwd, fname %} +hexo.extend.tag.register('pandown', function(args) { + if(/::/g.test(args)){ + args = args.join(' ').split('::'); + } + else{ + args = args.join(' ').split(','); + } + let type = ''; + let url = ''; + let pwd = ''; + let fname = ''; + if (args.length < 4) { + return; + } else if (args[0].trim() === 'yun') { + return '
对不起,pandown-tags不支持自定义
Sorry, pandown-tags does not support customization
' + } else { + type = args[0].trim(); + url = args[1].trim(); + pwd = args[2].trim(); + fname = args[3].trim(); + } + let result = ''; + // js + result += ' ' + return result; +});