update imports and define __filename and __dirname

This commit is contained in:
Nathan Price 2025-01-17 14:55:05 -05:00
parent 21ad72400d
commit fc47be65ea
No known key found for this signature in database

View File

@ -1,13 +1,18 @@
import { QuartzConfig } from "./quartz/cfg" import { QuartzConfig } from "./quartz/cfg"
import * as Plugin from "./quartz/plugins" import * as Plugin from "./quartz/plugins"
import * as fs from "fs" import { fileURLToPath } from "url"
import * as path from "path" import path from "path"
import fs from "fs"
/** /**
* Quartz 4.0 Configuration * Quartz 4.0 Configuration
* *
* See https://quartz.jzhao.xyz/configuration for more information. * See https://quartz.jzhao.xyz/configuration for more information.
*/ */
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const configPath = process.env.QUARTZ_CONFIG_PATH || path.resolve(__dirname, "config.json") const configPath = process.env.QUARTZ_CONFIG_PATH || path.resolve(__dirname, "config.json")
const rawData = fs.readFileSync(configPath, "utf-8") const rawData = fs.readFileSync(configPath, "utf-8")