General site configuration

  • title - site title, accessible in layouts and components through site.title
  • baseUrl - base url used to prefix urls when relative_url filter is used.
  • params - user defined parameters accessible through site.params
  • menus - global menu items. Read the Menus page for detailed options.
  • sass - SCSS configuration. Read the SASS page for detailed options.
baseurl: "/"
title: "Universal"
params:
  logo_img: "images/logo.svg"
  footer_link: "https://www.stackbit.com"
  show_social_media_links: true
menus:
  main:
    - identifier: home
      weight: 1
      url: /
      title: Home
    - identifier: features
      weight: 2
      url: features
        title: Features
  footer:
    - identifier: terms
      weight: 1
      url: terms.html
      title: Terms and Conditions
sass:
  input_file: sass/main.scss.njk
  output_file: assets/css/main.css
  indentWidth: 4
  outputStyle: nested
  precision: 10

Advanced fields:

  • init_js - This field is required to properly load and execute JavaScript files included in a theme when it is converted into Gatsby. This field should specify a path to a javascript file, relative to the static folder, that should be executed when the site is loaded by the browser and renders the initial page. For example, when a theme is converted to Gatsby, the file specified by this property is wrapped by Gatsby's onInitialClientRender API method. This method is executed when Gatsby finishes the initial rendering of the page. Code in this file could be used to manipulate or attach global event handlers to window, html or body elements. It must not store references or attach event handlers to elements located inside the body element, as these could be replaced by Gatsby when router navigation occurs. When a single instance element, such as a container for a dialog or a prompt, needs to be attached to the body element when the page is loaded, it can be be done in this file as well. Successive router navigation actions will not remove elements located directly in body as Gatsby changes the DOM only below its special container element having id="___gatsby".
  • page_load_js - Similar to init_js, this field should specify a path to a javascript file, relative to the static folder, that should be executed to manipulate contents of the body element for every rendered page. For example, when a theme is converted to Gatsby, the file specified by this property is wrapped by Gatsby's onRouteUpdate API method. This method is executed when React renders a new page and router history is changed. Code in this file could be used to manipulate or attach event listeners to elements inside the body element.
  • page_unload_js