update sass support

This commit is contained in:
yuki 2025-03-27 05:14:42 -03:00
parent cfbc244381
commit 2e3509de0e
Signed by: yuki
GPG key ID: 0C98E6FF04EC3915
2 changed files with 22 additions and 1 deletions

21
eleventy.config.js Normal file
View file

@ -0,0 +1,21 @@
const sass = require("sass");
module.exports = function (eleventyConfig) {
eleventyConfig.addTemplateFormats("scss");
// Creates the extension for use
eleventyConfig.addExtension("scss", {
outputFileExtension: "css", // optional, default: "html"
// `compile` is called once per .scss file in the input directory
compile: async function (inputContent) {
let result = sass.compileString(inputContent);
// This is the render function, `data` is the full data cascade
return async (data) => {
return result.css;
};
},
});
};

View file

@ -6,7 +6,7 @@
"scripts": {
"watch:eleventy": "npx @11ty/eleventy --watch",
"watch:sass": "npx sass sass:_site/css --watch",
"start": "npm run watch:eleventy & npm run watch:sass"
"start": "npm run watch:eleventy"
},
"keywords": [],
"author": "yuki",