mirror of
https://github.com/tcsenpai/obsidiangarden_netlify.git
synced 2025-06-04 12:00:02 +00:00
Sass should ignore theme.css file
This commit is contained in:
parent
9062a9cef6
commit
53ab95bd12
4
.gitignore
vendored
4
.gitignore
vendored
@ -3,6 +3,8 @@ dist
|
||||
netlify/functions/search/data.json
|
||||
netlify/functions/search/index.json
|
||||
src/site/styles/theme.*.css
|
||||
src/site/styles/_theme.*.css
|
||||
# Local Netlify folder
|
||||
.netlify
|
||||
.idea/
|
||||
.idea/
|
||||
.vercel
|
||||
|
@ -9,7 +9,7 @@ module.exports = async () => {
|
||||
if (baseUrl && !baseUrl.startsWith("http")) {
|
||||
baseUrl = "https://" + baseUrl;
|
||||
}
|
||||
let themeStyle = glob.sync("src/site/styles/theme.*.css")[0] || "";
|
||||
let themeStyle = glob.sync("src/site/styles/_theme.*.css")[0] || "";
|
||||
if (themeStyle) {
|
||||
themeStyle = themeStyle.split("site")[1];
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ async function getTheme() {
|
||||
|
||||
const res = await axios.get(themeUrl);
|
||||
try {
|
||||
const existing = glob.sync("src/site/styles/theme.*.css");
|
||||
const existing = glob.sync("src/site/styles/_theme.*.css");
|
||||
existing.forEach((file) => {
|
||||
fs.rmSync(file);
|
||||
});
|
||||
@ -30,7 +30,7 @@ async function getTheme() {
|
||||
hashSum.update(res.data);
|
||||
const hex = hashSum.digest("hex");
|
||||
fs.writeFileSync(
|
||||
`src/site/styles/theme.${hex.substring(0, 8)}.css`,
|
||||
`src/site/styles/_theme.${hex.substring(0, 8)}.css`,
|
||||
res.data
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user