-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy patheleventy.config.js
More file actions
47 lines (42 loc) · 1.72 KB
/
eleventy.config.js
File metadata and controls
47 lines (42 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import syntaxHighlight from "@11ty/eleventy-plugin-syntaxhighlight";
export default function(eleventyConfig) {
eleventyConfig.addPlugin(syntaxHighlight);
eleventyConfig.addPassthroughCopy("src/css");
eleventyConfig.addPassthroughCopy("src/images");
eleventyConfig.addPassthroughCopy("src/_redirects");
eleventyConfig.addPassthroughCopy("src/SKILL.md");
// Add language data globally
eleventyConfig.addGlobalData("languages", {
en: { name: "English", dir: "ltr", native: "English" },
es: { name: "Spanish", dir: "ltr", native: "Español" },
"pt-BR": { name: "Portuguese (Brazil)", dir: "ltr", native: "Português (Brasil)" },
"pt-PT": { name: "Portuguese (Portugal)", dir: "ltr", native: "Português (Portugal)" },
ko: { name: "Korean", dir: "ltr", native: "한국어" },
ja: { name: "Japanese", dir: "ltr", native: "日本語" },
"zh-CN": { name: "Chinese (Simplified)", dir: "ltr", native: "简体中文" },
"zh-TW": { name: "Chinese (Traditional)", dir: "ltr", native: "繁體中文" },
ar: { name: "Arabic", dir: "rtl", native: "العربية" },
ru: { name: "Russian", dir: "ltr", native: "Русский" },
tr: { name: "Turkish", dir: "ltr", native: "Türkçe" },
fr: { name: "French", dir: "ltr", native: "Français" },
});
// Dev server configuration: redirect root to /en/
eleventyConfig.setServerOptions({
onRequest: {
"/": function({ url }) {
const redirectUrl = new URL("/en/", url);
return Response.redirect(redirectUrl, 302);
}
}
});
return {
dir: {
input: "src",
output: "_site",
includes: "_includes",
layouts: "_layouts"
},
markdownTemplateEngine: "njk",
htmlTemplateEngine: "njk"
};
}