From 431539a363726e57c6e83eee6d05a3dd0767fd25 Mon Sep 17 00:00:00 2001 From: bfahrenfort Date: Sat, 31 Aug 2024 18:24:31 +1000 Subject: [PATCH] lint: format --- quartz.config.ts | 12 ++++-- quartz.layout.ts | 57 ++++++++++++++----------- quartz/components/Footer.tsx | 9 ++-- quartz/components/pages/TagContent.tsx | 2 +- quartz/components/renderPage.tsx | 33 +++++++++----- quartz/plugins/emitters/contentIndex.ts | 13 ++++-- quartz/plugins/transformers/remark42.ts | 10 ++--- quartz/styles/custom.scss | 5 +-- 8 files changed, 85 insertions(+), 56 deletions(-) diff --git a/quartz.config.ts b/quartz.config.ts index 6fa1d692f..57e35812b 100644 --- a/quartz.config.ts +++ b/quartz.config.ts @@ -13,6 +13,7 @@ const config: QuartzConfig = { enableSPA: true, enablePopovers: false, // https://github.com/jackyzha0/quartz/issues/890 analytics: null, + locale: "en-US", baseUrl: "be-far.com", ignorePatterns: ["private", "**/templates"], theme: { @@ -36,7 +37,7 @@ const config: QuartzConfig = { textHighlight: "#fff23688", }, darkMode: { - light: "#131829",// Backg + light: "#131829", // Backg lightgray: "#70778F", // Code Backg gray: "#686D82", // Unread nodes and subtitles darkgray: "#cdd6f4", // Text @@ -67,8 +68,13 @@ const config: QuartzConfig = { Plugin.TableOfContents(), Plugin.CrawlLinks({ markdownLinkResolution: "shortest" }), Plugin.Description(), - Plugin.Remark42({ host: "https://be-far.com/comments", site_id: "remark", theme: "dark", no_footer: true }), - Plugin.Latex({renderEngine: "katex"}) + Plugin.Remark42({ + host: "https://be-far.com/comments", + site_id: "remark", + theme: "dark", + no_footer: true, + }), + Plugin.Latex({ renderEngine: "katex" }), ], filters: [Plugin.RemoveDrafts()], emitters: [ diff --git a/quartz.layout.ts b/quartz.layout.ts index ce5381f0c..2309fe8e4 100644 --- a/quartz.layout.ts +++ b/quartz.layout.ts @@ -28,31 +28,38 @@ export const defaultContentPageLayout: PageLayout = { Component.MobileOnly(Component.Spacer()), Component.Search(), Component.Darkmode(), - Component.DesktopOnly(Component.Explorer({ - sortFn: (a, b) => { - const emojis = /([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g - const a_name = a.name.replace(emojis, '').trim() - const a_dname = a.displayName.replace(emojis, '').trim() - const b_name = b.name.replace(emojis, '').trim() - const b_dname = b.displayName.replace(emojis, '').trim() - // Sort order: folders first, then files. Sort folders and files alphabetically - if (/^.*Home$/.test(a_dname)) { return -1 } - if (/^.*Home$/.test(b_dname)) { return 1 } - if ((!a.file && !b.file) || (a.file && b.file)) { - // numeric: true: Whether numeric collation should be used, such that "1" < "2" < "10" - // sensitivity: "base": Only strings that differ in base letters compare as unequal. Examples: a ≠ b, a = á, a = A - return a_dname.localeCompare(b_dname, undefined, { - numeric: true, - sensitivity: "base", - }) - } - if (a.file && !b.file) { - return 1 - } else { - return -1 - } - } - })), + Component.DesktopOnly( + Component.Explorer({ + sortFn: (a, b) => { + const emojis = + /([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g + const a_name = a.name.replace(emojis, "").trim() + const a_dname = a.displayName.replace(emojis, "").trim() + const b_name = b.name.replace(emojis, "").trim() + const b_dname = b.displayName.replace(emojis, "").trim() + // Sort order: folders first, then files. Sort folders and files alphabetically + if (/^.*Home$/.test(a_dname)) { + return -1 + } + if (/^.*Home$/.test(b_dname)) { + return 1 + } + if ((!a.file && !b.file) || (a.file && b.file)) { + // numeric: true: Whether numeric collation should be used, such that "1" < "2" < "10" + // sensitivity: "base": Only strings that differ in base letters compare as unequal. Examples: a ≠ b, a = á, a = A + return a_dname.localeCompare(b_dname, undefined, { + numeric: true, + sensitivity: "base", + }) + } + if (a.file && !b.file) { + return 1 + } else { + return -1 + } + }, + }), + ), //Component.TableOfContents(), ], right: [ diff --git a/quartz/components/Footer.tsx b/quartz/components/Footer.tsx index e417e5b41..568d5f040 100644 --- a/quartz/components/Footer.tsx +++ b/quartz/components/Footer.tsx @@ -16,16 +16,17 @@ export default ((opts?: Optionss) => {