import { QuartzConfig } from "./quartz/cfg"
import * as Plugin from "./quartz/plugins"
import { LineAgePre, LineAgeMid, LineAgePost } from "quartz-line-age"

/**
 * Quartz 4 Configuration
 *
 * See https://quartz.jzhao.xyz/configuration for more information.
 */
const config: QuartzConfig = {
  configuration: {
    pageTitle: "Matsuura Tomoya Research Note",
    pageTitleSuffix: "",
    enableSPA: true,
    enablePopovers: true,
    locale: "ja-JP",
    analytics: {
      provider: "umami",
      websiteId:"40fab411-7f0c-4b80-ace2-a7b6bf6da522",
      host: "https://analytics.matsuuratomoya.com"
    },
    baseUrl: "garden.matsuuratomoya.com",
    repoUrl: "https://git.matsuuratomoya.com/tomoyanonymous/quartz-research-note",
    ignorePatterns: ["private", "templates", ".obsidian"],
    defaultDateType: "modified",
    fediverseCreator: "@tomoya@social.matsuuratomoya.com",
    theme: {
      fontOrigin: "googleFonts",
      cdnCaching: true,
      typography: {
        header: "Noto Sans JP",
        body: "Noto Sans JP",
        code: "IBM Plex Mono",
      },
      colors: {
        lightMode: {
          light: "#d7eff7",
          lightgray: "#f0f0f0",
          gray: "#4e4e4e",
          darkgray: "#4e4e4e",
          dark: "#284b63",
          secondary: "#207e8f",
          tertiary: "#84a59d",
          highlight: "rgba(243,143,51,0.25)",
          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",
        },
      },
    },
  },
  plugins: {
    transformers: [
      Plugin.FrontMatter(),
      LineAgePre(),
      Plugin.CreatedModifiedDate({
        priority: ["frontmatter", "git", "filesystem"],
      }),
      Plugin.Latex({ renderEngine: "katex" }),
      Plugin.SyntaxHighlighting({
        theme: {
          light: "github-light",
          dark: "github-dark",
        },
        keepBackground: false,
      }),
      Plugin.TableOfContents(),
      LineAgeMid(),
      Plugin.ObsidianFlavoredMarkdown({ enableInHtmlEmbed: false }),
      LineAgePost({
        freshColor: { r: 32, g: 126, b: 143 },
        oldColor: { r: 215, g: 239, b: 247 },
        darkModeFreshColor: { r: 235, g: 235, b: 236 }, //#ebebec
        darkModeOldColor: { r: 22, g: 22, b: 24 }, //#161618
      }),
      Plugin.GitHubFlavoredMarkdown(),
      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: true,
        enableRSS: true,
      }),
      Plugin.Assets(),
      Plugin.Static(),
      Plugin.Favicon(),
      Plugin.NotFoundPage(),
      // Comment out CustomOgImages to speed up build time
      Plugin.CustomOgImages(),
    ],
  },
}

export default config
