created site
This commit is contained in:
commit
1cd8f12a3c
30 changed files with 487 additions and 0 deletions
35
eleventy.config.mjs
Normal file
35
eleventy.config.mjs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
import path from "node:path";
|
||||
import * as sass from "sass";
|
||||
|
||||
export default function (eleventyConfig) {
|
||||
eleventyConfig.addGlobalData("layout", "default.liquid");
|
||||
|
||||
eleventyConfig.addPassthroughCopy("assets/images");
|
||||
eleventyConfig.addPassthroughCopy("assets/fonts");
|
||||
|
||||
// Creates the extension for use
|
||||
eleventyConfig.addExtension("scss", {
|
||||
outputFileExtension: "css", // optional, default: "html"
|
||||
useLayouts: false,
|
||||
|
||||
// `compile` is called once per .scss file in the input directory
|
||||
compile: async function (inputContent, inputPath) {
|
||||
let parsed = path.parse(inputPath);
|
||||
if (parsed.name.startsWith("_")) { return; }
|
||||
let result = sass.compileString(inputContent, {
|
||||
loadPaths: [
|
||||
parsed.dir || ".",
|
||||
this.config.dir.includes
|
||||
]
|
||||
});
|
||||
|
||||
this.addDependencies(inputPath, result.loadedUrls);
|
||||
|
||||
// This is the render function, `data` is the full data cascade
|
||||
return async (data) => {
|
||||
return result.css;
|
||||
};
|
||||
},
|
||||
});
|
||||
eleventyConfig.addTemplateFormats("scss");
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue