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