We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 651f637 commit eb62cabCopy full SHA for eb62cab
lib/notion/getPageProperties.js
@@ -205,7 +205,7 @@ function mapProperties(properties) {
205
/**
206
* 获取自定义URL
207
* 可以根据变量生成URL
208
- * 支持:%year%/%month%/%day%/%slug%
+ * 支持:%category%/%year%/%month%/%day%/%slug%
209
* @param {*} postProperties
210
* @returns
211
*/
@@ -227,6 +227,8 @@ function generateCustomizeSlug(postProperties) {
227
fullPrefix += String(formatPostCreatedDate.getUTCDate()).padStart(2, 0)
228
} else if (pattern === '%slug%') {
229
fullPrefix += postProperties.slug ?? postProperties.id
230
+ } else if (pattern === '%category%' && postProperties?.category) {
231
+ fullPrefix += postProperties.category
232
} else if (!pattern.includes('%')) {
233
fullPrefix += pattern
234
} else {
0 commit comments