locizify-ssg
TypeScript icon, indicating that this package has built-in type declarations

1.1.7 • Public • Published

Introduction

npm version

EXPERIMENTAL

This package helps to generate website pages on server side that uses locizify. This may help to improve SEO, etc.

Getting started

Source can be loaded via npm.

# npm package
$ npm install locizify-ssg

Usage via code:

import ssg from 'locizify-ssg'

ssg('index.html', ['de', 'it'], '{{lng}}.html', {
  // debug: true,
  fallbackLng: 'en',
  backend: {
    projectId: '123aa5aa-4660-4154-b6d9-907dbef10bb2',
    version: 'production'
  },
  namespace: 'landingpage'
})

// or
ssg('index.html', 'de', 'de.html', {
  // debug: true,
  fallbackLng: 'en',
  backend: {
    projectId: '123aa5aa-4660-4154-b6d9-907dbef10bb2',
    version: 'production'
  },
  namespace: 'landingpage'
})

Usage via CLI:

npm install locizify-ssg -g

# -i is the input file
# -o is the output file
# -l the languages
# -s the locizify options

locizify-ssg -i /Users/user/my/index.html -o /Users/user/my/de.html -l de -s "{\"fallbackLng\":\"en\",\"backend\":{\"projectId\":\"123aa5aa-4660-4154-b6d9-907dbef10bb2\",\"version\":\"production\"},\"namespace\":\"landingpage\"}"


# or for multiple languages

locizify-ssg -i /Users/user/my/index.html -o /Users/user/my/{{lng}}.html -l de,it,fr -s "{\"fallbackLng\":\"en\",\"backend\":{\"projectId\":\"123aa5aa-4660-4154-b6d9-907dbef10bb2\",\"version\":\"production\"},\"namespace\":\"landingpage\"}"

Package Sidebar

Install

npm i locizify-ssg

Weekly Downloads

136

Version

1.1.7

License

MIT

Unpacked Size

18.4 kB

Total Files

11

Last publish

Collaborators

  • adrai
  • jamuhl