Skip to content

Settings

The settings.json file in the project root directory stores the site template settings. When you initialize the site scaffolding template, this is the default configuration of the settings.json file:

json
{ 
   "name": "site-settings-json",
   "id":"505de083-d0bc-4892-9aa0-126a1b7205b6",
   "localization":{  
      "current":"eng",
      "original":"",
      "langs":[  
         "eng"
      ]
   },
   "browserslist": ["last 2 versions"],
   "uncss": {
   "ignore": [
      "/\\.footer-product-logo/",
      "/\\.item-text/",
      "/\\.m-center/"
      ]
   },
   "screenshoter": {
      "pageWithCommonLayout": "parent",
      "componentsOnEveryPage": [
         "#evenPageButton"
      ],
      "includeDocuments": true,
      "delay": 1000,
      "icons": {
        "blocks": {
          "width": 150,
          "enabled": true,
          "mode": "view"
         }
      },
      "thumbForEachTheme": false,
   },
   "clms": {
      "spa": {
         "keepOriginalFilename": [
            "common/media/pdfs/my.pdf",
            "**/*.pdf"
         ]
      },
      "aem": {
         "xmlPath": "aem.xml"
      },
   },
   "navigation": {
      "router": {
         "mode": "hash"
      }
   },
   "seo": {
      "robots": {
         "userAgents": [
            {
               "userAgent": "*",
               "allow": "/",
               "disallow": "/search",
               "sitemap": "https://www.example.com/sitemap.xml"
            },
            {
               "userAgent": [
                  "Googlebot-Image",
                  "Bingbot",
                  "Mediapartners-Google"
               ],
               "allow": [
                  "/",
                  "/search"
               ],
               "disallow": "/detail"
            }
         ],
      },
      "sitemap": {
         "changefreq": "always",
         "priority": 1.0
      } 
   }
}
                              Field                       Description
nameThe site template name.
idThe unique ID of the created site.
localizationInformation about the current localization and available languages of the site template.
browserslistDefines the supported browsers for demonstrating your site. This configuration is applicable in prefixing the CSS rules and polyfilling JS. The exporting engine applies these settings only when building the site for the target CLM app. For more information, see the Browserslist configuration syntax.
uncssDefines if the UnCSS tool is used in your site project. For more information, see UnCSS removal from site builds
screenshoterThe settings for taking the page screenshots when you export the site to the PDF format.
screenshoter.pageWithCommonLayoutThe ID of the page that has a screenshot of the common layout. By default, the screenshoter service takes the screenshot of the site common layout and components on the first page. The screenshots of other pages in the site include only the pages' content without components.
screenshoter.componentsOnEveryPageAn array of CSS selectors. The screenshots of components are taken for the common layout on every page. For example, References.
screenshoter.includeDocumentsA field that defines if the PDFs attached to the exported PDF. The default value is true. If set to false, the reference PDFs aren't added.
screenshoter.delayThe delay with which the icon is generated in milliseconds. For more information, see Set delay for generating a screenshot.
screenshoter.icons.blocks.enabledA boolean property that defines if the automatic generation of block icons is on. The default value is false. For more information, see Generate icons for blocks.
screenshoter.icons.blocks.widthDefines the width of the generated block icons in pixels. The property works if the screenshoter.icons.blocks.enabled is true. For more information, see Set generated icon width.
screenshoter.icons.blocks.modeDefines if the block icons are generated as in the eWizard Editor PREVIEW or EDIT mode. The default value is view. The property works if the screenshoter.icons.blocks.enabled is true. For more information, see Icons for view/edit mode.
screenshoter.thumbForEachThemeIf the value is set to false, the wiz thumbs command generates thumbnails only for the specific theme. If the value is set to true, the wiz thumbs command generates thumbnails for all themes except current to the directory specified in the thumbnails option in system settings. The current theme thumbnail is stored in the directory defined in the thumbnail option in system settings regardless of the thumbForEachTheme value. The default value is false.
clms.spa.keepOriginalFilenameEnter paths to files or file formats you want to keep the original name for instead of generating a unique name. For more information, see Keep original filename in a site build
clms.aem.xmlPathThe path to the XML file with settings for the AEM build. The file is generated after the site is exported to AEM and includes tokens that are replaced with actual values. If the property isn't defined, the default file is used.
navigation.router.modeIncludes the mode settings for the Vue router in multipage sites.
seoIncludes the SEO settings for multipage sites.
seo.robotsIncludes the SEO settings for the robots.txt file. For more information, read robots.txt.
seo.sitemapIncludes the sitemap.xml settings for user agents.

It is highly recommended to configure seo.robots.userAgents.allow and seo.robots.userAgents.disallow in the pages.json file to prevent issues when editing the file in eWizard Editor.

robots.txt

The robots.txt file includes settings for web crawlers that index websites.

You can configure the settings for the robots.txt file in the settings.json file.

The hideForSearchEngines option in pages.json has priority over the allow and disallow options in settings.json. If the same page is added to the allow object of settings.json and has the hideForSearchEngines as true in pages.json, the page is added to the Disallow object of the robots.txt file.

json
{
  "seo": {
    "robots": {
      "userAgents": [
        {
          "userAgent": "*",
          "allow": "/",
          "disallow": "/search",
          "sitemap": "https://www.example.com/sitemap.xml"
        },
        {
          "userAgent": [
            "Googlebot-Image",
            "Bingbot",
            "Mediapartners-Google"
          ],
          "allow": [
            "/",
            "/search"
          ],
          "disallow": "/detail"
        }
      ],
    }
  }
}

You can configure the following fields for the robots.txt file:

  • userAgent—the user agent you apply the instructions to. Enter * to apply the instruction to all user agents. The default value is *. Corresponds to the User-agent field in robots.txt.

  • allow—includes the pages the user agent can index. Enter /* to allow indexing for all pages. The default value is /*. Corresponds to the Allow field in robots.txt.

  • disallow—includes the pages the user agent can't index. Enter /* to disallow indexing for all pages. Corresponds to the Disallow field in robots.txt.

  • sitemap—the path to the sitemap of the multiple page site. The default value is generated based on the deployed domain of the site. For example, https://www.viseven.com/sitemap.xml. Corresponds to the Sitemap field in robots.txt.

After running a production build, the robots.txt file appears in the resulting build. The file content depends on the settings in settings.json and pages.json.

For example, when generating a build of a site with the following settings:

json
// ./settings.json

{
  "seo": {
    "robots": {
      "userAgents": [
        {
          "userAgent": "*",
          "allow": "/",
          "disallow": "/search"
        },
        {
          "userAgent": [
            "Googlebot-Image",
            "Bingbot",
            "Mediapartners-Google"
          ],
          "allow": [
            "/",
            "/search"
          ],
          "disallow": "/detail"
        }
      ],
      "sitemap": "https://www.example.com/sitemap.xml"
    }
  }
}

The following robots.txt file is generated:

txt
User-agent: *
Allow: /
Disallow: /search

User-agent: Googlebot-Image
Allow: /
Allow: /search
Disallow: /detail

User-agent: Bingbot
Allow: /
Allow: /search
Disallow: /detail

User-agent: Mediapartners-Google
Allow: /
Allow: /search
Disallow: /detail
Sitemap: https://www.example.com/sitemap.xml

Sitemap

The sitemap.xml file includes the metadata about the site pages for user agents.

You can configure the settings for the sitemap in settings.json and pages.json. It's useful to generate sitemap settings for the whole site in settings.json and apply settings for specific pages in pages.json.

The sitemap settings in pages.json have priority over settings from settings.json. If the same page has sitemap settings configured in both pages.json and settings.json, the settings from pages.json apply.

You can configure the following sitemap settings in settings.json.

json
// ./settings.json

{
   "seo": {
      "sitemap": {
         "hostname": "https://my.site",
         "changefreq": "always",
         "priority": 1.0,
         "lastmod": "2023-05-15T10:30:00+00:00",
      } 
   }
}
  • hostname—the URL of the site domain. Corresponds to the <loc> tag in the sitemap.xml file. The default value is https://my.site.

  • changefreq—frequency of the page refreshing. Corresponds to the <changefreq> tag in sitemap.xml. The default value is monthly. It can have the following values:

    • always

    • hourly

    • daily

    • weekly

    • monthly

    • yearly

    • never

    For more information about changefreq values, see sitemap.org protocol.

  • priority—the priority of the page relative to other pages. The range can vary from 0.0 to 1.0. The default value is 0.5. Corresponds to the <priority> tag in sitemap.xml

  • lastmod—the date when the page was last modified in the W3C date and time format. The default value is the date and time when the production build was generated. Corresponds to the <lastmod> tag in sitemap.xml.

After running a production build, the sitemap.xml is generated based on the settings.json and pages.json configurations.

For example, for the settings.json file with the following settings:

json
// ./settings.json

{
   "seo": {
      "sitemap": {
         "hostname": "https://www.example.com",
         "changefreq": "always",
         "priority": 1.0,
         "lastmod": "2023-05-15T10:30:00+00:00",
      } 
   }
}

The following sitemap.xml is generated:

xml
<!-- sitemap.xml -->

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
   <url>
      <loc>https://www.example.com</loc>
      <lastmod>2023-05-15T10:30:00+00:00</lastmod>
      <changefreq>always</changefreq>
      <priority>1.0</priority>
   </url>
</urlset>

For more information about settings in other template types, see Configuration.