Skip to content

Sitemap

The sitemap is an array defined by the sitemap property in mockkit.json. See mockkit.json for the full specification.

The information defined here is used when the Viewer lists the screens of the site in the left sidebar. It works like a table of contents for the project, so you need to update the sitemap when the project structure changes.

The following JSON is an example of the sitemap section in mockkit.json.

json
// mockkit.json (properties other than sitemap are omitted for explanation)
{
  "sitemap": [
    { "type": "page", "name": "Home", "path": "/" },
    {
      "type": "group",
      "name": "Unauthenticated Screens",
      "content": [
        { "type": "page", "name": "Product List", "path": "/products/" },
        { "type": "page", "name": "Product Detail", "path": "/products/0/" }
      ]
    }
  ]
}

Sitemap Items

Item Types

The sitemap can contain the following two types of items (screen information). Specify the item type with the type property.

Item typeDescription
groupDefines grouped items. Like a folder.
pageDefines a page. Like a file.

Display Name

Specify the display name of the item with the name property.

Path

Specify the path of the item with the path property.

INFO

The path property can only be specified for items where type = page.

Content

Specify the contents of the item with the content property.

The content property is an array that can contain multiple sitemap items.

INFO

The content property can only be specified for items where type = group.

Updating the Sitemap

When you run the mockkit dev or mockkit generate command, the sitemap information in mockkit.json is interpreted and written to the build output public directory. If the development server is running via the mockkit dev command, editing mockkit.json automatically triggers an update.

This lets the Viewer reference the latest sitemap information.