server: Fix path on dev environment

This commit is contained in:
Elian Doran 2024-11-02 15:01:58 +02:00
parent 48e6c1a33d
commit f8777b0de1
No known key found for this signature in database

View File

@ -9,6 +9,7 @@ import themeNames from "./code_block_theme_names.json" with { type: "json" }
import { t } from "i18next"; import { t } from "i18next";
import { join } from "path"; import { join } from "path";
import { getResourceDir } from "./utils.js"; import { getResourceDir } from "./utils.js";
import env from "./env.js";
/** /**
* Represents a color scheme for the code block syntax highlight. * Represents a color scheme for the code block syntax highlight.
@ -30,7 +31,8 @@ interface ColorTheme {
* @returns the supported themes, grouped. * @returns the supported themes, grouped.
*/ */
export function listSyntaxHighlightingThemes() { export function listSyntaxHighlightingThemes() {
const path = join(getResourceDir(), "styles"); const stylesDir = (env.isDev() ? "node_modules/@highlightjs/cdn-assets/styles" : "styles");
const path = join(getResourceDir(), stylesDir);
const systemThemes = readThemesFromFileSystem(path); const systemThemes = readThemesFromFileSystem(path);
return { return {