Skip to content

Commit 454a1df

Browse files
committed
【优化】调整推文标题长度限制,从20增加到50
1 parent 4db9554 commit 454a1df

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

blog/utils/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export const getTitleFromText = (text: string): string => {
116116
let endIdx = firstIdx === -1 ? arr.length : firstIdx
117117
let titleArr = arr.slice(0, endIdx)
118118
let title = titleArr.join('')
119-
const limit = 20
119+
const limit = 50
120120
if (titleArr.length > limit) {
121121
title = limitStr(title, limit)
122122
}

server/utils/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ exports.getTitleFromText = function (text) {
138138
let endIdx = firstIdx === -1 ? arr.length : firstIdx
139139
let titleArr = arr.slice(0, endIdx)
140140
let title = titleArr.join('')
141-
const limit = 20
141+
const limit = 50
142142
if (titleArr.length > limit) {
143143
title = this.limitStr(title, limit)
144144
}

0 commit comments

Comments
 (0)