Generating static internationalization html automatically
- Git clone this repo
- Open terminal and
cd
to the directory - Install dependencies by runing
yarn install
ornpm install
- Compile views by runing
yarn build
ornpm run build
After run the script, the output html files are in dist
directory.
- views: HTML templates (using: posthtml-expressions)
- locals: Local language json files
- dist: Output directory of HTML
- Add a
XXX.json
file intolocals
dir - Add a new script
"build:XXX": "cross-env APP_LANG=XXX parcel build views/**/*.html --out-dir=dist/XXX",
inpackage.json
file - Run
yarn build
ornpm run build
, and checkoutdist/XXX
directory
MIT