The conditions file is included in various parts of the theme. Its purpose is to set attributes as variables that affect how the theme is constructed. The settings in this file are essential for single sourcing.
Edit me

About the conditions.html file

The conditions file is a critical file that sets certain variables used in constructing the theme. You already set some of these values in the configuration file, but you need to duplicate some of the settings here. In this file, the settings are variable assignments.

This file is used as include in certain files. When used as an include, it sets variables that are used to configure your theme. Because you’re single sourcing your Jekyll content, you need this file.

Customize the conditions file

In the _includes/custom directory, open the conditions.html file. Duplicate one of the project settings blocks like this:

{% if site.project == "mydoc_writers" %}
{% assign audience = "writers" %}
{% assign sidebar = site.data.mydoc.mydoc_sidebar.entries %}
{% assign topnav = site.data.mydoc.mydoc_topnav.topnav %}
{% assign topnav_dropdowns = site.data.mydoc.mydoc_topnav.topnav_dropdowns %}
{% assign version = "all" %}
{% assign product = "all" %}
{% assign platform = "all" %}
{% assign projectTags = site.data.mydoc.mydoc_tags.allowed-tags %}
{% assign projectFolder = "mydoc" %}
{% endif %}

You need to duplicate this block for each output you have.

Once you’ve duplicated the block, make a few customizations:

  • In each place that “mydoc” appears, change “mydoc” to “acme”.
  • Use the same attributes for project, audience, version, product, and platform that you used in your configuration file. (If you don’t have a specific attribute value that you need, just put “all”.) The values here have to exactly match those in the configuration file.

Tags: navigation