diff --git a/quartz.config.ts b/quartz.config.ts index f58bc32e5..58c1d9cd9 100644 --- a/quartz.config.ts +++ b/quartz.config.ts @@ -4,12 +4,7 @@ import * as Plugin from "./quartz/plugins" const sharedPageComponents = { head: Component.Head(), - header: [ - Component.PageTitle(), - Component.Spacer(), - Component.Search(), - Component.Darkmode() - ], + header: [], footer: Component.Footer({ authorName: "Jacky", links: { @@ -25,11 +20,15 @@ const contentPageLayout: PageLayout = { Component.ReadingTime(), Component.TagList(), ], - left: [], + left: [ + Component.PageTitle(), + Component.Search(), + Component.TableOfContents(), + Component.Darkmode() + ], right: [ Component.Graph(), - Component.TableOfContents(), - Component.Backlinks() + Component.Backlinks(), ], } @@ -37,7 +36,11 @@ const listPageLayout: PageLayout = { beforeBody: [ Component.ArticleTitle() ], - left: [], + left: [ + Component.PageTitle(), + Component.Search(), + Component.Darkmode() + ], right: [], } @@ -46,6 +49,9 @@ const config: QuartzConfig = { pageTitle: "🪴 Quartz 4.0", enableSPA: true, enablePopovers: true, + analytics: { + provider: 'plausible', + }, canonicalUrl: "quartz.jzhao.xyz", ignorePatterns: ["private", "templates"], theme: { @@ -102,16 +108,16 @@ const config: QuartzConfig = { ...contentPageLayout, pageBody: Component.Content(), }), - Plugin.TagPage({ - ...sharedPageComponents, - ...listPageLayout, - pageBody: Component.TagContent(), - }), Plugin.FolderPage({ ...sharedPageComponents, ...listPageLayout, pageBody: Component.FolderContent(), }), + Plugin.TagPage({ + ...sharedPageComponents, + ...listPageLayout, + pageBody: Component.TagContent(), + }), Plugin.ContentIndex({ enableSiteMap: true, enableRSS: true, diff --git a/quartz/bootstrap-cli.mjs b/quartz/bootstrap-cli.mjs index 2824f8e96..3f71b1776 100755 --- a/quartz/bootstrap-cli.mjs +++ b/quartz/bootstrap-cli.mjs @@ -64,7 +64,7 @@ yargs(hideBin(process.argv)) packages: "external", plugins: [ sassPlugin({ - type: 'css-text' + type: 'css-text', }), { name: 'inline-script-loader', diff --git a/quartz/cfg.ts b/quartz/cfg.ts index 1c9ece8f7..49698ab51 100644 --- a/quartz/cfg.ts +++ b/quartz/cfg.ts @@ -2,12 +2,23 @@ import { QuartzComponent } from "./components/types" import { PluginTypes } from "./plugins/types" import { Theme } from "./theme" +export type Analytics = null + | { + provider: 'plausible' + } + | { + provider: 'google', + tagId: string + } + export interface GlobalConfiguration { pageTitle: string, /** Whether to enable single-page-app style rendering. this prevents flashes of unstyled content and improves smoothness of Quartz */ enableSPA: boolean, /** Whether to display Wikipedia-style popovers when hovering over links */ enablePopovers: boolean, + /** Analytics mode */ + analytics: Analytics /** Glob patterns to not search */ ignorePatterns: string[], /** Base URL to use for CNAME files, sitemaps, and RSS feeds that require an absolute URL. diff --git a/quartz/components/ArticleTitle.tsx b/quartz/components/ArticleTitle.tsx index c25769e2a..b8d58c6b3 100644 --- a/quartz/components/ArticleTitle.tsx +++ b/quartz/components/ArticleTitle.tsx @@ -2,9 +2,8 @@ import { QuartzComponentConstructor, QuartzComponentProps } from "./types" function ArticleTitle({ fileData }: QuartzComponentProps) { const title = fileData.frontmatter?.title - const displayTitle = fileData.slug === "index" ? undefined : title - if (displayTitle) { - return

{displayTitle}

+ if (title) { + return

{title}

} else { return null } diff --git a/quartz/components/Footer.tsx b/quartz/components/Footer.tsx index 4229f9d2e..5fc6d64c5 100644 --- a/quartz/components/Footer.tsx +++ b/quartz/components/Footer.tsx @@ -14,7 +14,7 @@ export default ((opts?: Options) => { return <>