This commit is contained in:
myw
2024-10-20 17:47:28 +08:00
parent 95ca6878f0
commit c72f8c41ec
32 changed files with 207 additions and 209 deletions

View File

@@ -1,10 +1,13 @@
'use strict'
const { stripHTML, prettyUrls, truncate } = require('hexo-util')
const { truncateContent, postDesc } = require('../common/postDesc')
const { prettyUrls } = require('hexo-util')
const crypto = require('crypto')
hexo.extend.helper.register('truncate', (content, length) => {
return truncate(stripHTML(content), { length, separator: ' ' }).replace(/\n/g, ' ')
hexo.extend.helper.register('truncate', truncateContent)
hexo.extend.helper.register('postDesc', data => {
return postDesc(data, hexo)
})
hexo.extend.helper.register('cloudTags', function (options = {}) {