chore: 更新 Quartz 配置文件

更新 Quartz 配置文件以适应新的页面标题、语言区域和基础 URL。还更新了字体、颜色和主题配置。移除了一些不必要的插件和过滤器,并添加了一些新的组件布局。
This commit is contained in:
2024-09-05 14:53:34 +00:00
parent 28fe466ea3
commit ac1e12eb0e
2 changed files with 78 additions and 62 deletions

View File

@@ -8,86 +8,86 @@ import * as Plugin from "./quartz/plugins"
*/ */
const config: QuartzConfig = { const config: QuartzConfig = {
configuration: { configuration: {
pageTitle: "🪴 Quartz 4.0", pageTitle: "🪴 X·Eden", // 页面标题
enableSPA: true, enableSPA: true, // 启用单页应用
enablePopovers: true, enablePopovers: true, // 启用弹出框
analytics: { analytics: {
provider: "plausible", provider: 'umami', host: 'https://umami.7wate.com/', websiteId: 'c061efdc-95dd-4d21-9d04-a1ffda0a85b9'
}, },
locale: "en-US", locale: "zh-CN", // 语言区域
baseUrl: "quartz.jzhao.xyz", baseUrl: "wiki.7wate.com", // 基础 URL
ignorePatterns: ["private", "templates", ".obsidian"], ignorePatterns: ["Obsidian", ".obsidian"], // 忽略的模式
defaultDateType: "created", defaultDateType: "created", // 默认日期类型
theme: { theme: {
fontOrigin: "googleFonts", fontOrigin: "googleFonts", // 字体来源
cdnCaching: true, cdnCaching: true, // 启用 CDN 缓存
typography: { typography: {
header: "Schibsted Grotesk", header: "Noto Serif Simplified Chinese", // 标题字体
body: "Source Sans Pro", body: "Source Sans Pro", // 正文字体
code: "IBM Plex Mono", code: "IBM Plex Mono", // 代码字体
}, },
colors: { colors: {
lightMode: { lightMode: {
light: "#faf8f8", light: "#faf8f8", // 浅色
lightgray: "#e5e5e5", lightgray: "#e5e5e5", // 浅灰色
gray: "#b8b8b8", gray: "#b8b8b8", // 灰色
darkgray: "#4e4e4e", darkgray: "#4e4e4e", // 深灰色
dark: "#2b2b2b", dark: "#2b2b2b", // 深色
secondary: "#284b63", secondary: "#284b63", // 次要颜色
tertiary: "#84a59d", tertiary: "#84a59d", // 第三颜色
highlight: "rgba(143, 159, 169, 0.15)", highlight: "rgba(143, 159, 169, 0.15)", // 高亮颜色
textHighlight: "#fff23688", textHighlight: "#fff23688", // 文本高亮颜色
}, },
darkMode: { darkMode: {
light: "#161618", light: "#161618", // 浅色
lightgray: "#393639", lightgray: "#393639", // 浅灰色
gray: "#646464", gray: "#646464", // 灰色
darkgray: "#d4d4d4", darkgray: "#d4d4d4", // 深灰色
dark: "#ebebec", dark: "#ebebec", // 深色
secondary: "#7b97aa", secondary: "#7b97aa", // 次要颜色
tertiary: "#84a59d", tertiary: "#84a59d", // 第三颜色
highlight: "rgba(143, 159, 169, 0.15)", highlight: "rgba(143, 159, 169, 0.15)", // 高亮颜色
textHighlight: "#b3aa0288", textHighlight: "#b3aa0288", // 文本高亮颜色
}, },
}, },
}, },
}, },
plugins: { plugins: {
transformers: [ transformers: [
Plugin.FrontMatter(), Plugin.FrontMatter(), // 前置数据
Plugin.CreatedModifiedDate({ Plugin.CreatedModifiedDate({
priority: ["frontmatter", "filesystem"], priority: ["frontmatter", "filesystem"], // 创建和修改日期
}), }),
Plugin.SyntaxHighlighting({ Plugin.SyntaxHighlighting({
theme: { theme: {
light: "github-light", light: "github-light", // 浅色主题
dark: "github-dark", dark: "github-dark", // 深色主题
}, },
keepBackground: false, keepBackground: false, // 保持背景
}), }),
Plugin.ObsidianFlavoredMarkdown({ enableInHtmlEmbed: false }), Plugin.ObsidianFlavoredMarkdown({ enableInHtmlEmbed: false }), // Obsidian 风格的 Markdown
Plugin.GitHubFlavoredMarkdown(), Plugin.GitHubFlavoredMarkdown(), // GitHub 风格的 Markdown
Plugin.TableOfContents(), Plugin.TableOfContents(), // 目录
Plugin.CrawlLinks({ markdownLinkResolution: "shortest" }), Plugin.CrawlLinks({ markdownLinkResolution: "shortest" }), // 链接爬取
Plugin.Description(), Plugin.Description(), // 描述
Plugin.Latex({ renderEngine: "katex" }), Plugin.Latex({ renderEngine: "katex" }), // LaTeX 渲染
], ],
filters: [Plugin.RemoveDrafts()], filters: [Plugin.RemoveDrafts()], // 移除草稿
emitters: [ emitters: [
Plugin.AliasRedirects(), Plugin.AliasRedirects(), // 别名重定向
Plugin.ComponentResources(), Plugin.ComponentResources(), // 组件资源
Plugin.ContentPage(), Plugin.ContentPage(), // 内容页面
Plugin.FolderPage(), Plugin.FolderPage(), // 文件夹页面
Plugin.TagPage(), Plugin.TagPage(), // 标签页面
Plugin.ContentIndex({ Plugin.ContentIndex({
enableSiteMap: true, enableSiteMap: true, // 启用站点地图
enableRSS: true, enableRSS: true, // 启用 RSS
}), }),
Plugin.Assets(), Plugin.Assets(), // 资源
Plugin.Static(), Plugin.Static(), // 静态文件
Plugin.NotFoundPage(), Plugin.NotFoundPage(), // 404 页面
], ],
}, },
} }
export default config export default config

View File

@@ -1,23 +1,31 @@
import { PageLayout, SharedLayout } from "./quartz/cfg" import { PageLayout, SharedLayout } from "./quartz/cfg"
import * as Component from "./quartz/components" import * as Component from "./quartz/components"
import { QuartzPluginData } from "./quartz/plugins/vfile"
// components shared across all pages // 跨所有页面共享的组件
export const sharedPageComponents: SharedLayout = { export const sharedPageComponents: SharedLayout = {
head: Component.Head(), head: Component.Head(),
header: [], header: [],
afterBody: [], afterBody: [],
footer: Component.Footer({ footer: Component.Footer({
links: { links: {
GitHub: "https://github.com/jackyzha0/quartz", "Home": "https://www.7wate.com",
"Discord Community": "https://discord.gg/cRFFHYye7t", "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 = { export const defaultContentPageLayout: PageLayout = {
beforeBody: [ beforeBody: [
Component.Breadcrumbs(), Component.Breadcrumbs({
spacerSymbol: "", // 面包屑符号
rootName: "Home", // 根元素名称
resolveFrontmatterTitle: true, // 解析前置数据标题
hideOnRoot: true, // 在根页面隐藏面包屑
showCurrentPage: true, // 显示当前页面
}),
Component.ArticleTitle(), Component.ArticleTitle(),
Component.ContentMeta(), Component.ContentMeta(),
Component.TagList(), Component.TagList(),
@@ -28,15 +36,23 @@ export const defaultContentPageLayout: PageLayout = {
Component.Search(), Component.Search(),
Component.Darkmode(), Component.Darkmode(),
Component.DesktopOnly(Component.Explorer()), 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: [ right: [
Component.Graph(), Component.Graph(),
Component.DesktopOnly(Component.TableOfContents()), 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 = { export const defaultListPageLayout: PageLayout = {
beforeBody: [Component.Breadcrumbs(), Component.ArticleTitle(), Component.ContentMeta()], beforeBody: [Component.Breadcrumbs(), Component.ArticleTitle(), Component.ContentMeta()],
left: [ left: [
@@ -47,4 +63,4 @@ export const defaultListPageLayout: PageLayout = {
Component.DesktopOnly(Component.Explorer()), Component.DesktopOnly(Component.Explorer()),
], ],
right: [], right: [],
} }