From d1a4e8e9b930b12e0eb0e74d78989fd09c4e7cf0 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Tue, 6 Jun 2023 23:24:18 +0800 Subject: [PATCH] post-url --- lib/notion/getPageProperties.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/notion/getPageProperties.js b/lib/notion/getPageProperties.js index 185bc008..1d4554df 100644 --- a/lib/notion/getPageProperties.js +++ b/lib/notion/getPageProperties.js @@ -172,5 +172,9 @@ function generateCustomizeUrl(postProperties) { fullSlug += '/' } }) + if (fullSlug.startsWith('/')) { + fullSlug = fullSlug.substring(1) // 去掉头部的"/" + } + return `${fullSlug}/${(postProperties.slug ?? postProperties.id)}` }