Files
o-k-i.net/eleventy.config.js
T

44 lines
1.3 KiB
JavaScript
Raw Normal View History

2025-11-05 17:32:17 +04:00
module.exports = function(eleventyConfig) {
// Locale-aware content: `t` resolves to the content bundle for the page's locale (fr by default)
eleventyConfig.addGlobalData("eleventyComputed", {
locale: (data) => data.locale || "fr",
t: (data) => data.i18n[data.locale || "fr"]
});
2025-11-05 17:32:17 +04:00
// Copy assets folders to output
eleventyConfig.addPassthroughCopy("src/assets");
2025-11-05 17:41:27 +04:00
// Copy SEO files
eleventyConfig.addPassthroughCopy("src/robots.txt");
eleventyConfig.addPassthroughCopy("src/sitemap.xml");
// Copy Apache security headers config to the site root
eleventyConfig.addPassthroughCopy({ "src/.htaccess": ".htaccess" });
2025-11-05 17:32:17 +04:00
// Watch CSS files for changes
eleventyConfig.addWatchTarget("src/assets/css/");
// Watch JS files for changes
eleventyConfig.addWatchTarget("src/assets/js/");
// Dynamic current-year shortcode for the footer
eleventyConfig.addShortcode("year", () => new Date().getFullYear().toString());
2025-11-05 17:32:17 +04:00
// Configure browser sync to reload on CSS changes
eleventyConfig.setBrowserSyncConfig({
files: ['_site/assets/css/**/*.css', '_site/assets/js/**/*.js']
});
return {
dir: {
input: "src",
output: "_site",
includes: "_includes",
data: "_data"
},
templateFormats: ["html", "md", "njk", "liquid"],
htmlTemplateEngine: "njk",
markdownTemplateEngine: "njk"
};
};