_config.yml

An archaeological excursion into the depths of available configuration.

You may have heard we have a lot of sites running the same theme. How? Well, because we put a bunch of junk into the config, that’s how! Neat. If you discover some new config options please add them here.

Metadata

title

This is appended to the <title> of every page in the docs, so it will be something like _config.yml | Docs docs. It’s also used at the top of the sidebar.

versions

TODO: Document this. Used in Meteor docs/guide.

Example:

1
2
3
4
5
6
7
8
sidebar_categories:
null:
- index
- formatting
Technical:
- setup
- recipes
- config

This is what organizes all the pages into a sidebar. The top-level keys are the categories, allowing you to group pages into thematic categories.

The keys inside are the filenames, without .md. So for example, if you have a source/formatting.md, you should just put formatting. You can also use subdirectories, like basics/queries.

Recently we added a feature that allows the sidebar to link to other sites entirely by specifying a title and href:

1
2
3
4
5
6
7
8
9
10
11
12
13
sidebar_categories:
null:
- index
- example
Servers:
- servers/express
- servers/hapi
- servers/koa
Related:
- title: graphql-tools
href: https://www.apollographql.com/docs/graphql-tools/
- title: GraphQL Subscriptions
href: https://www.apollographql.com/docs/graphql-subscriptions/

Social / APIs

Use these to add various buttons/integrations/social stuff.

GitHub

1
2
github_repo: apollographql/docs-docs
content_root: source

This is used to power the “Edit on GitHub” buttons on the pages. The repo is used to construct the GitHub URL, and the content root is when you have the content in a nested directory.

Twitter

1
2
social_links:
twitter: '@apollographql'

Used for Tweets to identify us as the owner of the page.

Slack

1
2
social_links:
slackInvitePage: 'https://www.apollographql.com/#slack'

Adds a “Discuss on Slack” button to the pages with this URL.

Segment

1
2
apis:
segment: wgrIo8Bul0Ujl8USETG3DB6hONdy4kTg

Add segment analytics for page loads.

Google Tag Manager

1
2
apis:
gtm: GTM-PNFDVBB

Add GTM to every page.

URLs

1
2
3
4
# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: https://www.apollographql.com/docs/docs/
root: /docs/docs/

Source directory

TODO document this

1
2
3
# Directory
source_dir: source
public_dir: public/docs/docs

Unused / broken

Please fix these, or remove them if you see them in a config file.

subtitle

It’s only used in the placeholder text in the search field.

description

Totally unused.

Edit on GitHub