1.2 Configuring the site

Wagon site created: check. Next up, we need to do some basic configuration for our site.

YAML

Wagon uses YAML configuration files. New to YAML? There's nothing to be scared of. YAML files have the following dead simple format:

property_name: Property value

Easy, right? I'm just going to let you pick it up as we go, but those intereseted in the finer points should consult the example below.

# This comment is ignored by Wagon, but useful to you and me.
property_a: Put anything here

# You can nest properties
property_b:
    foo: Blah blah
    bar: 18.9

property_c: "Wrap values in quotes to get fancy with symbols like # : & [ ]"

property_d: "Escaping quotes is \"easy,\" just use backslashes."

site.yml

Open the config/site.yml file. This file sets various site-wide settings. The first property in site.yml is name, which holds the name of our site. Let's change it to something more human friendly.

name: "Wisdom for Wanderers"

The next two options, subdomain and domains, only apply to sites being deployed on multi-site Engines. We'll come back to this topic in chapter 5.

The locales option let's us specify what languages our website will be available in. For now, let's leave this at the default value.

locales: [en]

The next option, timezone, lets us set what timezone we would like server times to be displayed in. I'm going to set it to US Central Time, like so:

timezone: "Central Time (US & Canada)"

Wagon uses the ActiveSupport::TimeZone class to interpret these strings. So, consult the API documentation linked above to see a list of valid strings. Most time zones can be inferred from the city name. Here's a list some sample values:

  • Tokyo
  • Hawaii
  • Pacific Time (US & Canada)
  • Eastern Time (US & Canada)
  • Paris
  • Istanbul

The last settings are related to Search Engine Optimization (SEO). Like everything else in this file, these can be changed later so I won't stress too much about what I enter for now.

seo_title: Travel Tips for the Adventurous!
meta_keywords: "travel backpacking budget adventure"
meta_description: "Learn about cool places to see abroad, interesting things to eat, and little travel tips you won't believe you lived without."

Great, we're all done with site.yml.

translations.yml

Since our blog is just going to be in English for now, let's ignore the translations.yml file. We'll come back to this is section four.

deploy.yml

And we won't be deploying our site for a little bit, so let's leave this blank as well. We'll come back to this in section five.

Finishing up

That didn't take long. Those new to YAML are now up to speed and we've made some basic configuration changes for the site. Let's commit the changes and move on.

$ git add config/site.yml
$ git commit -m "Updated site configuration"

Onwards and upwards! In the next chapter we'll start making our blog's home page, so stay tuned.

Next: the index page
© 2024 LocomotiveCMS Terms of use Privacy Policy
Back to top