- NodeJs
- NPM (included with NodeJs)
- Clone this repository
git clone https://github.com/jcletousey/personal-website
- cd into the project directory and run
npm install
- Once all the dependencies are installed run
npm start
- Open your browser at http://localhost:8080
- Blog
- Internationalization
The internationalization is used to provide links to users in order for them to switch to another supported language.
This featuref is provided by the Eleventy i18n plugin.
If you want to use it as is, you have to localize your data. It means that you have to write and organize your content accordingly to the languages you want to provide.
What you have to do is to apply the following instructions:
- The default language is English but you can change it in the
.eleventy.js
file at the root of the project.
module.exports = function (eleventyConfig) {
// Plugins
...
eleventyConfig.addPlugin(EleventyI18nPlugin, {
defaultLanguage: "en",
});
- Declare your locales in
data/site.json
{
...,
"locales": {
"en": "English",
"fr": "Français"
}
}
- Create the corresponding directories in the
content
directory. For example, with an english and a french locales:
|- src
|- content
|- en
|- blog
|- pages
|- fr
|- blog
|- pages
|- ...
- Then, you have to create files with the same name across the locales folders to get automatic links for the translations.
For example:
|- src
|- content
|- en
|- blog
|- my-first-post.md
|- my-second-post.md
|- my-third-post.md # This won't have translation
|- pages
|- my-page.md
|- fr
|- blog
|- my-first-post.md
|- my-second-post.md
|- mon-article.md # This won't have translation
|- pages
|- my-page.md
|- ...