Skip to content

Commit

Permalink
Sass should ignore theme.css file
Browse files Browse the repository at this point in the history
  • Loading branch information
Ole Eskild Steensen committed Jan 22, 2023
1 parent 9062a9c commit 53ab95b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/site/_data/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down
4 changes: 2 additions & 2 deletions src/site/get-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand All @@ -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
);
}
Expand Down

0 comments on commit 53ab95b

Please sign in to comment.