import { QuartzConfig } from "./quartz/cfg"
import * as Plugin from "./quartz/plugins"

/**
 * Quartz 4 Configuration
 *
 * See https://quartz.jzhao.xyz/configuration for more information.
 */
const config: QuartzConfig = {
  configuration: {
    pageTitle: "Memos",
    pageTitleSuffix: "",
    enableSPA: true,
    enablePopovers: false,
    analytics: null,
    locale: "de-DE",
    baseUrl: "memos.maddin.app",
    ignorePatterns: ["private", "templates", ".obsidian"],
    defaultDateType: "created",
    theme: {
      fontOrigin: "local",
      cdnCaching: false,
      typography: {
        header: "Aptos, ui-sans-serif, system-ui, sans-serif",
        body: "Aptos, ui-sans-serif, system-ui, sans-serif",
        code: "IBM Plex Mono, ui-monospace, monospace",
      },
      colors: {
        lightMode: {
          light: "#f6f3ee",
          lightgray: "#e3ddd2",
          gray: "#b5ab9c",
          darkgray: "#5a5148",
          dark: "#241f1a",
          secondary: "#8c4f2b",
          tertiary: "#35605a",
          highlight: "rgba(140, 79, 43, 0.12)",
          textHighlight: "#f1d48788",
        },
        darkMode: {
          light: "#191512",
          lightgray: "#393029",
          gray: "#75695d",
          darkgray: "#ddd5cb",
          dark: "#f5efe8",
          secondary: "#d6946c",
          tertiary: "#7dc2b9",
          highlight: "rgba(214, 148, 108, 0.16)",
          textHighlight: "#9a7b2588",
        },
      },
    },
  },
  plugins: {
    transformers: [
      Plugin.FrontMatter(),
      Plugin.CreatedModifiedDate({
        priority: ["frontmatter", "git", "filesystem"],
      }),
      Plugin.SyntaxHighlighting({
        theme: {
          light: "github-light",
          dark: "github-dark",
        },
        keepBackground: false,
      }),
      Plugin.ObsidianFlavoredMarkdown({ enableInHtmlEmbed: false }),
      Plugin.GitHubFlavoredMarkdown(),
      Plugin.TableOfContents(),
      Plugin.CrawlLinks({ markdownLinkResolution: "shortest" }),
      Plugin.Description(),
      Plugin.Latex({ renderEngine: "katex" }),
    ],
    filters: [Plugin.RemoveDrafts()],
    emitters: [
      Plugin.AliasRedirects(),
      Plugin.ComponentResources(),
      Plugin.ContentPage(),
      Plugin.FolderPage(),
      Plugin.TagPage(),
      Plugin.ContentIndex({
        enableSiteMap: false,
        enableRSS: false,
      }),
      Plugin.Assets(),
      Plugin.Static(),
      Plugin.Favicon(),
      Plugin.NotFoundPage(),
    ],
  },
}

export default config
