├── .gitignore ├── src ├── about.njk ├── landingpage.njk ├── _data │ ├── about │ │ ├── fr.json │ │ └── en.json │ └── landingpage │ │ ├── en.json │ │ └── fr.json └── _includes │ └── layouts │ ├── base.njk │ ├── about.njk │ └── landingpage.njk ├── www ├── about │ ├── fr │ │ └── index.html │ └── index.html ├── index.html └── fr │ └── index.html ├── .eleventy.js └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /src/about.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: about 3 | --- 4 | -------------------------------------------------------------------------------- /src/landingpage.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: landingpage 3 | --- 4 | -------------------------------------------------------------------------------- /src/_data/about/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "locale": "fr", 3 | "hero": { 4 | "title": "Sur moi" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/_data/about/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "locale": "en", 3 | "hero": { 4 | "title": "About Me" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/_data/landingpage/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "locale": "en", 3 | "hero": { 4 | "title": "Hello World" 5 | }, 6 | "cta": { 7 | "title": "Click here" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/_data/landingpage/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "locale": "fr", 3 | "hero": { 4 | "title": "Bonjour le monde" 5 | }, 6 | "cta": { 7 | "title": "Cliquez ici" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/_includes/layouts/base.njk: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{ title }} 6 | 7 | 8 |
{{ content | safe }}
9 | 10 | 11 | -------------------------------------------------------------------------------- /www/about/fr/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Sur moi 6 | 7 | 8 |
9 |

Sur moi

10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /www/about/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | About Me 6 | 7 | 8 |
9 |

About Me

10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /www/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hello World 6 | 7 | 8 |
9 |

Hello World

10 | 11 | 12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /www/fr/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Bonjour le monde 6 | 7 | 8 |
9 |

Bonjour le monde

10 | 11 | 12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /src/_includes/layouts/about.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: base 3 | pagination: 4 | data: about 5 | size: 1 6 | alias: t 7 | resolve: values 8 | permalink: "/about/{% if t.locale != 'en' %}{{ t.locale | slugify }}/{% endif %}" 9 | eleventyComputed: 10 | locale: "{{ t.locale }}" 11 | title: "{{ t.hero.title }}" 12 | --- 13 | 14 |

{{ t.hero.title }}

15 | -------------------------------------------------------------------------------- /.eleventy.js: -------------------------------------------------------------------------------- 1 | module.exports = function (eleventyConfig) { 2 | eleventyConfig.addLayoutAlias("base", "layouts/base.njk"); 3 | eleventyConfig.addLayoutAlias("about", "layouts/about.njk"); 4 | eleventyConfig.addLayoutAlias("landingpage", "layouts/landingpage.njk"); 5 | 6 | return { 7 | dir: { 8 | input: "src", 9 | output: "www", 10 | } 11 | }; 12 | }; 13 | -------------------------------------------------------------------------------- /src/_includes/layouts/landingpage.njk: -------------------------------------------------------------------------------- 1 | --- 2 | layout: base 3 | pagination: 4 | data: landingpage 5 | size: 1 6 | alias: t 7 | resolve: values 8 | permalink: "/{% if t.locale != 'en' %}{{ t.locale | slugify }}/{% endif %}" 9 | eleventyComputed: 10 | locale: "{{ t.locale }}" 11 | title: "{{ t.hero.title }}" 12 | --- 13 | 14 |

{{ t.hero.title }}

15 | 16 | 17 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "11ty-2366", 3 | "description": "", 4 | "version": "1.0.0", 5 | "author": "Peter deHaan ", 6 | "bugs": { 7 | "url": "https://github.com/pdehaan/11ty-2366/issues" 8 | }, 9 | "devDependencies": { 10 | "@11ty/eleventy": "^1.0.1" 11 | }, 12 | "homepage": "https://github.com/pdehaan/11ty-2366#readme", 13 | "keywords": [], 14 | "license": "MPL-2.0", 15 | "main": ".eleventy.js", 16 | "repository": { 17 | "type": "git", 18 | "url": "git+https://github.com/pdehaan/11ty-2366.git" 19 | }, 20 | "scripts": { 21 | "build": "eleventy", 22 | "test": "echo \"Error: no test specified\" && exit 1" 23 | } 24 | } 25 | --------------------------------------------------------------------------------