Member-only story

Migrate docusaurus from v1 to v2

What to notes.

Donald Le
2 min readJul 15, 2021
Photo by Ali Choubin on Unsplash
yarn run start

Only start website with default language.

If you want to run lively with different language, choose

yarn run start -- --locale vi

Change nginx.conf if needed, for example all the docs file are named index.html inside the directory, so we need to rewrite url by nginx.

server {listen 80;set $subdomain $1;location / {root   /usr/share/nginx/html;index  docs/intro/index.html;rewrite /$ "$subdomain${uri}index.html" break;try_files $uri $uri/ $uri.html /index.html;}error_page   500 502 503 504  /50x.html;location = /50x.html {root   /usr/share/nginx/html;}}

Put translation files in i18n/{language}

For example

├── en
└── vi
├── code.json
├── docusaurus-plugin-content-docs
│ ├── current
│ │ ├── about_data
│ │ │ ├── data_processing
│ │ │ │ ├── data_flow.md
│ │ │…

--

--

Donald Le
Donald Le

Written by Donald Le

A passionate automation engineer who strongly believes in “A man can do anything he wants if he puts in the work”.

No responses yet