In the Kinsta build logs, liquid
files are being built, but in my configuration file, I have set the template formats to md
, njk
, and html
.
This leads me to think that my configuration file is not being read in the build process.
I have tried to run npx @11ty/eleventy --config=eleventy.config.js
and npx @11ty/eleventy --config=./eleventy.config.js
but both deploys failed with a file not found error.
Build settings
-
command: npx @11ty/eleventy
-
Node version: 20
-
Root directory: src
-
Publish directory: _site
That produce the following logs:
...
Apr 18 20:19:36 đ ď¸ Running build command: npx @11ty/eleventy
Apr 18 20:19:36
Apr 18 20:19:37 [11ty] Writing ./_site/admin/index.html from ./admin/index.html (liquid)
Apr 18 20:19:37 [11ty] Writing ./_site/index.html from ./index.md (liquid)
Apr 18 20:19:37 [11ty] Wrote 2 files in 0.14 seconds (v3.0.0)
Apr 18 20:19:37
Apr 18 20:19:37 â
Build command succeeded
Apr 18 20:19:37
Apr 18 20:19:38 đ Publishing '_site' directory...
...
eleventy config
// eleventy.config.js <-Located at the root of the project
const fs = require("fs");
const path = require("path");
module.exports = function(eleventyConfig) {
// Set directories
eleventyConfig.addPassthroughCopy("src/css");
eleventyConfig.addPassthroughCopy("src/imgs");
// Add admin directory decap
eleventyConfig.addPassthroughCopy("admin");
eleventyConfig.addCollection("galleryImages", function(collectionApi) {
const dir = "src/imgs/gallery";
return fs.readdirSync(dir)
.filter(file => /\.(jpg|jpeg|png|gif)$/i.test(file))
.map(file => ({
src: `imgs/gallery/${file}`,
alt: path.parse(file).name
}));
});
return {
dir: {
input: "src",
includes: "_includes",
data: "_data",
output: "_site"
},
// Add template formats
templateFormats: ["md", "njk", "html"],
// Add markdown plugins
markdownTemplateEngine: "njk",
htmlTemplateEngine: "njk",
dataTemplateEngine: "njk",
// Add passthrough file copy
passthroughFileCopy: true
};
};
I have been able to successfully build locally and on netlify. Both show pass through files being copied and nunchucks being written. Iâm omitting them 'cause this post is already pretty long.
Any help would be appreciated, thank you very much for your time.