DPDK Architecture  ->  Library (v3.4.4)

Configuration

Before you start using the Hydrate function (and working on the project in general) it's important to add the proper configuration based on the project requirements like multilingual support.

Because the hydrate function handles all data for the application it uses all of these values under the hood.

Let's take a look at some commented example configuration :

{
  "prismic": {
    // Always set enabled to true
    "enabled": true,
    // Prismic is cloud based, this id will connect your project and the CMS
    "project": "dpdk-architecture",
    // Routes allow for automatic data handling
    // > Type is connected to the content type in the CMS
    // > Path is the route that will match automatically
    // ~ :uid in the route will look for multi page content
    // ~ No :uid in the route will look for single page content 
    "routes": [
      {
        "type": "product", //
        "path": "/products/:uid"
      },
      {
        "type": "homepage",
        "path": "/"
      }
    ],
    // This locales array is required for us to do some additional mapping
    // Prismic uses "en-us" and we want "en" in the url
    // If the project only has one language or en/nl, just use this
    "locales": [
      ["en", "en-us"],
      ["nl", "nl-nl"]
    ]
  }
}
Last modifiedMonday, August 30, 2021, 2:00:02 PM UTC
Last authorColin van Eenige
Commit IDfd08685