2025-11-05 17:32:17 +04:00
|
|
|
module.exports = function(eleventyConfig) {
|
2026-07-06 08:14:20 +04:00
|
|
|
// 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");
|
|
|
|
|
|
2026-07-07 23:56:56 +04:00
|
|
|
// 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/");
|
|
|
|
|
|
2026-07-09 02:17:53 +04:00
|
|
|
// 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"
|
|
|
|
|
};
|
|
|
|
|
};
|