From a403850ca22de6204500ca7de8d27140b2bae42e Mon Sep 17 00:00:00 2001 From: dihwang Date: Thu, 9 Apr 2026 11:23:14 +0900 Subject: [PATCH] =?UTF-8?q?Revert=20"filterFn=20=EA=B7=B8=EC=A7=80?= =?UTF-8?q?=EA=B0=99=EB=84=A4"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b10a88d5d22ac70341ea8806c94930dfb7a5c4c4. --- quartz.layout.ts | 50 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/quartz.layout.ts b/quartz.layout.ts index 970a5be..a95eff4 100644 --- a/quartz.layout.ts +++ b/quartz.layout.ts @@ -38,7 +38,30 @@ export const defaultContentPageLayout: PageLayout = { { Component: Component.ReaderMode() }, ], }), - Component.Explorer(), + Component.Explorer({ + filterFn: (node) => { + // 1. 숨기고 싶은 키워드 (index.md의 title에 적은 것과 폴더명 모두 포함) + const omitWords = ["extra", "template", "note", "volume"] + + // 파일(페이지)은 기본적으로 보여줍니다. + if (node.file) return true + + // 2. node가 가진 다양한 이름 속성들을 싹 다 긁어모읍니다. + const namesToCheck = [ + node.name, + node.displayName, + node.file?.frontmatter?.title // index.md가 있다면 그 안의 title까지 + ] + + // 3. 하나라도 omitWords에 포함되어 있는지 확인합니다. + const shouldOmit = namesToCheck.some(name => { + const lowerName = name?.toLowerCase() ?? "" + return omitWords.some(word => lowerName.includes(word)) + }) + + return !shouldOmit + }, + }), ], right: [ Component.Graph(), @@ -62,7 +85,30 @@ export const defaultListPageLayout: PageLayout = { { Component: Component.Darkmode() }, ], }), - Component.Explorer(), + Component.Explorer({ + filterFn: (node) => { + // 1. 숨기고 싶은 키워드 (index.md의 title에 적은 것과 폴더명 모두 포함) + const omitWords = ["extra", "template", "note", "volume"] + + // 파일(페이지)은 기본적으로 보여줍니다. + if (node.file) return true + + // 2. node가 가진 다양한 이름 속성들을 싹 다 긁어모읍니다. + const namesToCheck = [ + node.name, + node.displayName, + node.file?.frontmatter?.title // index.md가 있다면 그 안의 title까지 + ] + + // 3. 하나라도 omitWords에 포함되어 있는지 확인합니다. + const shouldOmit = namesToCheck.some(name => { + const lowerName = name?.toLowerCase() ?? "" + return omitWords.some(word => lowerName.includes(word)) + }) + + return !shouldOmit + }, + }), ], right: [], }