feat: disable to use the path as the category

This commit is contained in:
KazooTTT
2025-01-04 12:13:12 +08:00
parent 77f2cf5356
commit 41f21eb853
2 changed files with 14 additions and 8 deletions

View File

@ -7,6 +7,7 @@ const contentDir = path.join(__dirname, '../src/content/post')
// full path, root path, parent path
const getCategoryMode = 'parent'
const isGetCategoryFromPath = false
function toCamelCase(str) {
return str
@ -56,6 +57,11 @@ function getCategoryFromPath(filePath) {
function processFile(filePath) {
const fileContent = fs.readFileSync(filePath, 'utf8')
if (!isGetCategoryFromPath) {
return
}
const category = getCategoryFromPath(filePath)
if (!category) {