adamduncan / eleventy-l10n-demo

Demo for handling Apache Content Negotiation

Home Page:https://eleventy-l10n-demo.netlify.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Eleventy l10n demo

Demo for handling Apache Content Negotiation in an Eleventy site.

Based on discussion in 11ty/eleventy#761

Demo site can be found at https://eleventy-l10n-demo.netlify.app, with English (default), Japanese and Spanish language pages (/ and /about/).

Install

npm install

Run locally

Attempted to leverage Netlify CLI to run site locally, hoping it'd adhere to the redirects defined in netlify.toml.

npm i -g netlify-cli
netlify dev

But thinking Eleventy's Browsersync setup gets in the way here?

Instead if we're in Apache land and want to leverge the site's .htaccess redirect rules, perhaps we'd want to run the site (npm start) and then run MAMP (or similar) locally, pointing to output _site directory?

Spoofing Language

Quick Accept-Language Switcher makes it super simple to alter Accept-Language value, to confirm user language settings are honoured.

About

Demo for handling Apache Content Negotiation

https://eleventy-l10n-demo.netlify.app


Languages

Language:Nunjucks 92.7%Language:JavaScript 7.3%