diff --git a/src/lib/PostComponent.svelte b/src/lib/PostComponent.svelte index 6cb6bcd..1cacc28 100644 --- a/src/lib/PostComponent.svelte +++ b/src/lib/PostComponent.svelte @@ -71,7 +71,7 @@ >

{post.authorHandle}@{post.authorHandle} { - const themeFile = Config.THEME; - console.log(`Using theme file: ${themeFile}`); + const themeFolder = Config.THEME; + console.log(`Using theme folder: ${themeFolder}`); return { name: 'theme-generator', enforce: 'pre', // Ensure this plugin runs first transform(code, id) { if (id.endsWith('app.css')) { - const colorsCode = Deno.readTextFileSync(Deno.cwd() + '/src/themes/colors.css'); // Read the theme file and replace the contents of app.css with it // Needs full path to the file - const themeCode = Deno.readTextFileSync(Deno.cwd() + '/src/themes/' + themeFile); + const themeCode = Deno.readTextFileSync(Deno.cwd() + '/themes/' + themeFolder + '/theme.css'); // Replace the contents of app.css with the theme code // and add a comment at the top - const themeComment = `/* Generated from ${themeFile} */\n`; - const themeCodeWithComment = themeComment + colorsCode + themeCode; + const themeComment = `/* Generated from ${themeFolder} */\n`; + const themeCodeWithComment = themeComment + themeCode; // Return the theme code as the new contents of app.css return { code: themeCodeWithComment,