From ac1e12eb0e0cf64254e2a7be4afea62a10422883 Mon Sep 17 00:00:00 2001 From: zopiya Date: Thu, 5 Sep 2024 14:53:34 +0000 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=20Quartz=20?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新 Quartz 配置文件以适应新的页面标题、语言区域和基础 URL。还更新了字体、颜色和主题配置。移除了一些不必要的插件和过滤器,并添加了一些新的组件布局。 --- quartz.config.ts | 108 +++++++++++++++++++++++------------------------ quartz.layout.ts | 32 ++++++++++---- 2 files changed, 78 insertions(+), 62 deletions(-) diff --git a/quartz.config.ts b/quartz.config.ts index b6abbb2d..72913813 100644 --- a/quartz.config.ts +++ b/quartz.config.ts @@ -8,86 +8,86 @@ import * as Plugin from "./quartz/plugins" */ const config: QuartzConfig = { configuration: { - pageTitle: "🪴 Quartz 4.0", - enableSPA: true, - enablePopovers: true, + pageTitle: "🪴 X·Eden", // 页面标题 + enableSPA: true, // 启用单页应用 + enablePopovers: true, // 启用弹出框 analytics: { - provider: "plausible", + provider: 'umami', host: 'https://umami.7wate.com/', websiteId: 'c061efdc-95dd-4d21-9d04-a1ffda0a85b9' }, - locale: "en-US", - baseUrl: "quartz.jzhao.xyz", - ignorePatterns: ["private", "templates", ".obsidian"], - defaultDateType: "created", + locale: "zh-CN", // 语言区域 + baseUrl: "wiki.7wate.com", // 基础 URL + ignorePatterns: ["Obsidian", ".obsidian"], // 忽略的模式 + defaultDateType: "created", // 默认日期类型 theme: { - fontOrigin: "googleFonts", - cdnCaching: true, + fontOrigin: "googleFonts", // 字体来源 + cdnCaching: true, // 启用 CDN 缓存 typography: { - header: "Schibsted Grotesk", - body: "Source Sans Pro", - code: "IBM Plex Mono", + header: "Noto Serif Simplified Chinese", // 标题字体 + body: "Source Sans Pro", // 正文字体 + code: "IBM Plex Mono", // 代码字体 }, colors: { lightMode: { - light: "#faf8f8", - lightgray: "#e5e5e5", - gray: "#b8b8b8", - darkgray: "#4e4e4e", - dark: "#2b2b2b", - secondary: "#284b63", - tertiary: "#84a59d", - highlight: "rgba(143, 159, 169, 0.15)", - textHighlight: "#fff23688", + light: "#faf8f8", // 浅色 + lightgray: "#e5e5e5", // 浅灰色 + gray: "#b8b8b8", // 灰色 + darkgray: "#4e4e4e", // 深灰色 + dark: "#2b2b2b", // 深色 + secondary: "#284b63", // 次要颜色 + tertiary: "#84a59d", // 第三颜色 + highlight: "rgba(143, 159, 169, 0.15)", // 高亮颜色 + textHighlight: "#fff23688", // 文本高亮颜色 }, darkMode: { - light: "#161618", - lightgray: "#393639", - gray: "#646464", - darkgray: "#d4d4d4", - dark: "#ebebec", - secondary: "#7b97aa", - tertiary: "#84a59d", - highlight: "rgba(143, 159, 169, 0.15)", - textHighlight: "#b3aa0288", + light: "#161618", // 浅色 + lightgray: "#393639", // 浅灰色 + gray: "#646464", // 灰色 + darkgray: "#d4d4d4", // 深灰色 + dark: "#ebebec", // 深色 + secondary: "#7b97aa", // 次要颜色 + tertiary: "#84a59d", // 第三颜色 + highlight: "rgba(143, 159, 169, 0.15)", // 高亮颜色 + textHighlight: "#b3aa0288", // 文本高亮颜色 }, }, }, }, plugins: { transformers: [ - Plugin.FrontMatter(), + Plugin.FrontMatter(), // 前置数据 Plugin.CreatedModifiedDate({ - priority: ["frontmatter", "filesystem"], + priority: ["frontmatter", "filesystem"], // 创建和修改日期 }), Plugin.SyntaxHighlighting({ theme: { - light: "github-light", - dark: "github-dark", + light: "github-light", // 浅色主题 + dark: "github-dark", // 深色主题 }, - keepBackground: false, + keepBackground: false, // 保持背景 }), - Plugin.ObsidianFlavoredMarkdown({ enableInHtmlEmbed: false }), - Plugin.GitHubFlavoredMarkdown(), - Plugin.TableOfContents(), - Plugin.CrawlLinks({ markdownLinkResolution: "shortest" }), - Plugin.Description(), - Plugin.Latex({ renderEngine: "katex" }), + Plugin.ObsidianFlavoredMarkdown({ enableInHtmlEmbed: false }), // Obsidian 风格的 Markdown + Plugin.GitHubFlavoredMarkdown(), // GitHub 风格的 Markdown + Plugin.TableOfContents(), // 目录 + Plugin.CrawlLinks({ markdownLinkResolution: "shortest" }), // 链接爬取 + Plugin.Description(), // 描述 + Plugin.Latex({ renderEngine: "katex" }), // LaTeX 渲染 ], - filters: [Plugin.RemoveDrafts()], + filters: [Plugin.RemoveDrafts()], // 移除草稿 emitters: [ - Plugin.AliasRedirects(), - Plugin.ComponentResources(), - Plugin.ContentPage(), - Plugin.FolderPage(), - Plugin.TagPage(), + Plugin.AliasRedirects(), // 别名重定向 + Plugin.ComponentResources(), // 组件资源 + Plugin.ContentPage(), // 内容页面 + Plugin.FolderPage(), // 文件夹页面 + Plugin.TagPage(), // 标签页面 Plugin.ContentIndex({ - enableSiteMap: true, - enableRSS: true, + enableSiteMap: true, // 启用站点地图 + enableRSS: true, // 启用 RSS }), - Plugin.Assets(), - Plugin.Static(), - Plugin.NotFoundPage(), + Plugin.Assets(), // 资源 + Plugin.Static(), // 静态文件 + Plugin.NotFoundPage(), // 404 页面 ], }, } -export default config +export default config \ No newline at end of file diff --git a/quartz.layout.ts b/quartz.layout.ts index 4a78256a..3c9c8c27 100644 --- a/quartz.layout.ts +++ b/quartz.layout.ts @@ -1,23 +1,31 @@ import { PageLayout, SharedLayout } from "./quartz/cfg" import * as Component from "./quartz/components" +import { QuartzPluginData } from "./quartz/plugins/vfile" -// components shared across all pages +// 跨所有页面共享的组件 export const sharedPageComponents: SharedLayout = { head: Component.Head(), header: [], afterBody: [], footer: Component.Footer({ links: { - GitHub: "https://github.com/jackyzha0/quartz", - "Discord Community": "https://discord.gg/cRFFHYye7t", + "Home": "https://www.7wate.com", + "Blog": "https://blog.7wate.com", + GitHub: "https://github.com/7wate", }, }), } -// components for pages that display a single page (e.g. a single note) +// 单页显示的组件布局 export const defaultContentPageLayout: PageLayout = { beforeBody: [ - Component.Breadcrumbs(), + Component.Breadcrumbs({ + spacerSymbol: "❯", // 面包屑符号 + rootName: "Home", // 根元素名称 + resolveFrontmatterTitle: true, // 解析前置数据标题 + hideOnRoot: true, // 在根页面隐藏面包屑 + showCurrentPage: true, // 显示当前页面 + }), Component.ArticleTitle(), Component.ContentMeta(), Component.TagList(), @@ -28,15 +36,23 @@ export const defaultContentPageLayout: PageLayout = { Component.Search(), Component.Darkmode(), Component.DesktopOnly(Component.Explorer()), + Component.DesktopOnly(Component.RecentNotes({ + title: "博客", + limit: 3, + showTags: false, + filter: (data: QuartzPluginData) => { + return data.filePath ? data.filePath.startsWith('content/Personal/Blog') : false + } + })), ], right: [ Component.Graph(), Component.DesktopOnly(Component.TableOfContents()), - Component.Backlinks(), + Component.MobileOnly(Component.Explorer()), ], } -// components for pages that display lists of pages (e.g. tags or folders) +// 列表页面显示的组件布局 export const defaultListPageLayout: PageLayout = { beforeBody: [Component.Breadcrumbs(), Component.ArticleTitle(), Component.ContentMeta()], left: [ @@ -47,4 +63,4 @@ export const defaultListPageLayout: PageLayout = { Component.DesktopOnly(Component.Explorer()), ], right: [], -} +} \ No newline at end of file