This repository contains the files needed to build Eleventy-based static sites for the Fluid Project.
You can use this repository as a template for a new site hosted on Netlify with Netlify CMS pre-configured:
- Install the required NPM packages:
npm install
- Run Eleventy in development mode:
npm start
.
The website will be available at http://localhost:8080.
You can build and serve the website from a Docker container.
Once you have Docker installed, run the following commands to build a Docker image and start a container:
- Build the image:
docker build -t trivet .
- Run the container:
docker run --name trivet -p 8000:80 trivet
The website will be available at http://localhost:8000
If you make changes to the website, repeat the steps to build the image and start a new container.
- Install the required NPM packages:
npm install
- Run the build script:
npm run build
- Upload the contents of the
./dist/
directory to the web root of your server.
If you make changes to the website, repeat step 2 to build the website and upload any changed files from the ./dist/
directory to the web root of your server.
- Integrated UI Options Preferences Editor.
- Basic static site configuration for developing project websites and blogs.
- Starter configuration for Netlify CMS.
- Internationalization support.
Modifications can be made to any source file or directory except for the contents of the ./dist/
directory. The
./dist/
directory is not versioned since it contains the built website that Eleventy generates from the source files,
and files in dist
are overwritten at build time.
The Netlify CMS configuration can be edited in src/admin/config.yml
.
For full documentation, see the Netlify CMS documentation.
Trivet includes internationalization support for English (Canada) and French (Canada). To add a language, the following changes need to be made:
-
Update the
languages
object ofsrc/_data/config.json
to add the new language. For example, to add Farsi, you would use the IETF language code as the key, and add the following object values:- a short form of the language code for use in permalinks
- a short form of the language code that corresponds to an available message bundle locale for Infusion's User Interface Options
- the direction (
ltr
for left to right orrtl
for right to left) - the localized language name (endonym)
{ "languages": { "fa-IR": { "slug": "fa", "uioSlug": "fa", "dir": "rtl", "name": "فارسی" } } }
You can set the site's default language by changing the
defaultLanguage
value insrc/_data/config.json
to the IETF language code of the desired default language. -
Add sections for the new language to
src/_data/site.json
andsrc/_data/translations.json
, translating the content from the English source. The key will always be the language code as used inconfig.json
. -
Add folders in each collection for translated content. For example, you would add a folder called
fa-IR
tosrc/collections/pages
andsrc/collections/posts
. -
Create a localized version of the posts archive page, following the example of
src/posts.fr-CA.md
. (Note: as per Eleventy's default configuration, Markdown files are processed with the Liquid template language. If for some reason one decides to modify this to use Nunjucks or another template language, the permalink syntax in all post archive pages will need to be modified to use the chosen template language.)
For more information about how Netlify CMS works with internationalized content, see the internationalization support documentation.
Trivet is available under the New BSD License.
Trivet is based on other publicly available software, categorized by license: