- Generate a website to be deployed in several domains (e.g.
com.ng, com.gh, com.eg, com.tn, ke, ci, ma
) - Each domain can have different languages available nuxt-i18n
- Support RTL
- Possibility to define the default language for each domain
- Possibility to use markdown files as cms blocks @nuxtjs/markdownit
- All domains have the same pages however CMS blocks can be customized by country and language
- Generate the sitemap.xml @nuxtjs/sitemap
- Generate the robots.txt @nuxtjs/robots
# Create a .env file with the following content
BASE_URL=http://localhost:3000
NUXT_ENV_COUNTRY=eg # can be ng, ke, gh, eg, ci, ma, tn
# install dependencies
$ yarn install
# serve with hot reload at localhost:3000
$ yarn dev
# generate static project
$ yarn generate
{
"code": "pt", // language code
"name": "PortuguΓͺs", // language display name
"iso": "pt-PT", // language ISO code
"file": "pt.js", // filename where the translations will be present
"rtl": false // Right-to-left enabled or disabled
}
- Create the folder
data/cms-blocks/pt
(the language code for Portugal).
.
ββ data
ββ cms-blocks
ββ ar
ββ en
ββ fr
ββ pt # new language being added
- Create every CMS block existent to the other languages
cms-blocks
ββ pt
ββ block1.md
ββ block2.md
ββ terms-and-conditions.md
π Congratulation, we are ready to associate the Portuguese language to the desired countries.
Add the following structure to the data/countries.json
file:
{
// other languages are nested here
"pt": {
"languages": [ "pt", "en" ], // available languages for Portugal
"default": "pt" // default language
}
}
cms-blocks
ββ pt # Portuguese language code
ββ br # Portugal country code
| ββ terms-and-conditions.md # CMS block being overrided
ββ block1.md
ββ block2.md
ββ terms-and-conditions.md