Giter Club home page Giter Club logo

react-static-i18n-routes's Introduction

react-static-i18n-routes

create react-static routes from markdown with i18n support

This is a utility library to quickly produce a i18n and SEO friendly react-static by generating i18n routes eg /de/about. Works great with Netlify CMS.

codecov circleci

Usage

In your react-static static.config.js file:

import generateRoutes from 'react-static-i18n-routes'
// ...
getRoutes: async () => {
    const routes = generateRoutes({
      contentFolder: 'content',
      defaultLocale: 'en',
      locales: ['en', 'fi'],
    })

    return [
      ...routes,
      // rest of your routes
    ]
}

API

  • contentFolder <string>: Base folder where you store your markdown files
  • defaultLocale <string>: Your default locale eg. en.
  • contentFolder <string>[]: List of all your locales eg. ['en', 'de', 'se'].

Install

With npm installed, run

$ npm install react-static-i18n-routes

License

MIT

react-static-i18n-routes's People

Contributors

jsaari97 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.