diff --git a/src/site/_data/meta.js b/src/site/_data/meta.js index dc2b3e3..4d51778 100644 --- a/src/site/_data/meta.js +++ b/src/site/_data/meta.js @@ -4,8 +4,22 @@ const axios = require("axios"); module.exports = async() => { let themeStyle = ""; - if (process.env.THEME) { - const res = await axios.get(process.env.THEME) + let themeUrl = process.env.THEME; + if (themeUrl) { + //https://forum.obsidian.md/t/1-0-theme-migration-guide/42537 + //Not all themes with no legacy mark have a theme.css file, so we need to check for it + try{ + await axios.get(themeUrl); + }catch{ + if(themeUrl.indexOf("theme.css") > -1){ + themeUrl = themeUrl.replace("theme.css", "obsidian.css"); + } + else if(themeUrl.indexOf("obsidian.css") > -1){ + themeUrl = themeUrl.replace("obsidian.css", "theme.css"); + } + } + + const res = await axios.get(themeUrl); themeStyle = ``; } const meta ={