From ae069f460f41645811414d37b217e2262878bf9e Mon Sep 17 00:00:00 2001 From: dihwang Date: Thu, 9 Apr 2026 11:04:11 +0900 Subject: [PATCH] =?UTF-8?q?=EC=BB=A4=EB=B0=8B=EB=A9=94=EC=8B=9C=EC=A7=80?= =?UTF-8?q?=20=EC=A0=81=EA=B8=B0=EB=8F=84=20=EA=B7=80=EC=B0=AE=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- quartz.config.ts | 2 +- quartz.layout.ts | 38 ++++++++++++++++++++++++++------------ 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/quartz.config.ts b/quartz.config.ts index 6d1aca9..ecbe175 100644 --- a/quartz.config.ts +++ b/quartz.config.ts @@ -17,7 +17,7 @@ const config: QuartzConfig = { }, locale: "en-US", baseUrl: "kui-white-smith.duckdns.org", - ignorePatterns: ["private", "templates", ".obsidian", "template","extra"], + ignorePatterns: ["private", "templates", ".obsidian", "00.Extra", "99.Template"], defaultDateType: "modified", theme: { fontOrigin: "googleFonts", diff --git a/quartz.layout.ts b/quartz.layout.ts index 9fd5d14..a95eff4 100644 --- a/quartz.layout.ts +++ b/quartz.layout.ts @@ -40,17 +40,24 @@ export const defaultContentPageLayout: PageLayout = { }), Component.Explorer({ filterFn: (node) => { - // 1. 탐색기에서 아예 빼버릴 단어들 (대소문자 무관) + // 1. 숨기고 싶은 키워드 (index.md의 title에 적은 것과 폴더명 모두 포함) const omitWords = ["extra", "template", "note", "volume"] - // 파일(페이지)은 필터링하지 않고 보여줍니다. + // 파일(페이지)은 기본적으로 보여줍니다. if (node.file) return true - // 폴더 이름이 존재하면 소문자로 변환 - const folderName = node.name?.toLowerCase() ?? "" + // 2. node가 가진 다양한 이름 속성들을 싹 다 긁어모읍니다. + const namesToCheck = [ + node.name, + node.displayName, + node.file?.frontmatter?.title // index.md가 있다면 그 안의 title까지 + ] - // 2. 폴더 이름에 omitWords 중 하나라도 포함되어 있으면 숨깁니다 (false 반환) - const shouldOmit = omitWords.some(word => folderName.includes(word)) + // 3. 하나라도 omitWords에 포함되어 있는지 확인합니다. + const shouldOmit = namesToCheck.some(name => { + const lowerName = name?.toLowerCase() ?? "" + return omitWords.some(word => lowerName.includes(word)) + }) return !shouldOmit }, @@ -80,17 +87,24 @@ export const defaultListPageLayout: PageLayout = { }), Component.Explorer({ filterFn: (node) => { - // 1. 탐색기에서 아예 빼버릴 단어들 (대소문자 무관) + // 1. 숨기고 싶은 키워드 (index.md의 title에 적은 것과 폴더명 모두 포함) const omitWords = ["extra", "template", "note", "volume"] - // 파일(페이지)은 필터링하지 않고 보여줍니다. + // 파일(페이지)은 기본적으로 보여줍니다. if (node.file) return true - // 폴더 이름이 존재하면 소문자로 변환 - const folderName = node.name?.toLowerCase() ?? "" + // 2. node가 가진 다양한 이름 속성들을 싹 다 긁어모읍니다. + const namesToCheck = [ + node.name, + node.displayName, + node.file?.frontmatter?.title // index.md가 있다면 그 안의 title까지 + ] - // 2. 폴더 이름에 omitWords 중 하나라도 포함되어 있으면 숨깁니다 (false 반환) - const shouldOmit = omitWords.some(word => folderName.includes(word)) + // 3. 하나라도 omitWords에 포함되어 있는지 확인합니다. + const shouldOmit = namesToCheck.some(name => { + const lowerName = name?.toLowerCase() ?? "" + return omitWords.some(word => lowerName.includes(word)) + }) return !shouldOmit },