---
title: "Variables and conditional processing in Jekyll versus DITA"
date: 2015-03-26
description: "Jekyll versus DITA   1.0 Check out Ed Marsh"
canonical_url: https://idratherbewriting.com/2015/03/26/variables-and-conditional-processing-jekyll-versus-dita/
---
# Variables and conditional processing in Jekyll versus DITA
## Variables in Jekyll

In Jekyll, you can assign a variable a specific value, like this:

Now you can use `{{dog_name}}` in your content and it will say `Fred` in the output:

Although you could assign this variable directly on your page, it's more common to put the variable in your configuration file. Each Jekyll project has a configuration file where you define your project settings and other build details.

The configuration file is written in YML syntax, so you just add a key-value pair somewhere in the file like this:

In a single sourcing scenario, you would have a separate configuration file for each output. On your page, you access that variable in the configuration file with the `site` namespace, like this:

Now if I have 3 outputs, and I want my dog's name to change for each output, I create 3 separate configuration files. In each configuration file, I assign a different value to `dog_name`. When the site builds, it will use the name assigned in the configuration file.