Configuration

In addition to the usual Jekyll configuration options, there are many options specific to Open SDG. These are detailed below, along with usage examples.

Note about "strings": Many of the settings detailed here contain human-readable "strings" (ie, text). In most cases, they can be replaced by translation keys for better multilingual support. For example, "Indicator" could be replaced with "general.indicator".

Required settings

country

This required setting should contain two more (indented) settings: name and adjective. This are intended to allow the platform to refer to the country (or if appropriate, locality or organisation) using the platform.

country:
  name: Australia
  adjective: Australian

data_edit_url

This required setting controls the URL of the "Edit Data" that appear on the staging site's indicator pages. It should be a full URL. Note that you can include [id] in the URL, and it will be dynamically replaced with the indicator's id (dash-delimited).

data_edit_url: http://prose.io/#my-org/my-repo/edit/develop/data/indicator_[id].csv

email_contacts

This required setting should contain three more (indented) settings for email addresses: questions, suggestions, and functional. This allows the platform to direct users to appropriate inboxes from various parts of your site.

email_contacts:
  questions: test@example.com
  suggestions: test@example.com
  functional: test@example.com

environment

This required setting should be either staging or production. Certain features of the platform, such as data management links, will only appear on staging. Typically you will have this set to staging in the _config.yml file, and set to production in the _config_prod.yml file.

environment: staging

goal_image_base

This required setting controls the base URL for downloading the imagery for the goals (PNG files). The platform will use this as a base, and complete the URLs (behind the scenes) by adding a language and number. For example, if you set this to https://example.com, then the platform will try to download the Spanish image for Goal 4 at: https://example.com/en/4.png.

goal_image_base: https://open-sdg.github.io/sdg-translations/assets/img/goals

languages

This required setting controls the languages to be used on the site. This should be a list of language codes, and the first is assumed to be the default.

Note that the Jekyll defaults mechanism should also be used, to ensure that all pages on the will be assigned a default language.

languages:
  - es
  - en

defaults:
  -
    scope:
      path: ""
    values:
      language: "es"

metadata_edit_url

This required setting controls the URL of the "Edit Metadata" that appear on the staging site's indicator pages. It should be a full URL. Note that you can include [id] in the URL, and it will be dynamically replaced with the indicator's id (dash-delimited).

metadata_edit_url: http://prose.io/#my-org/my-repo/edit/develop/meta/[id].md

This required setting controls the main navigation menu for the platform. It should contain a list of menu items, each containing a path and a translation key.

menu:
  - path: /reporting-status
    translation_key: menu.reporting_status
  - path: /about
    translation_key: menu.about
  - path: /faq
    translation_key: menu.faq

plugins

This is a general Jekyll setting, but it is mentioned here to indicate the required plugins. At a minimum you should include the following:

plugins:
  - jekyll-remote-theme
  - jekyll-open-sdg-plugins

remote_data_prefix

This required setting tells the platform where to find your hosted data repository.

remote_data_prefix: https://my-github-org.github.io/my-data-repository

remote_theme

This is not specific to Open SDG, but it is very important to always use a specific version of Open SDG (as opposed to using the latest version). For example, to use version 0.8.0 of the platform, use the following:

remote_theme: open-sdg/open-sdg@0.8.0

This is far safer and more recommended than using the latest version, such as the following (which is not recommended):

remote_theme: open-sdg/open-sdg

remote_translations

This required setting tells the platform where look for remote language translation files. Note that this should be list of one or more URLs, which allows you to pull in multiple translation files.

remote_translations:
  - https://open-sdg.github.io/sdg-translations/translations.json

Optional settings

analytics

This optional setting can contain another (indented) setting, ga_prod, which should be a Google Analytics tracking ID. If these settings are used, usage statistics will be sent to Google Analytics. For more information about this, see the analytics page.

analytics:
  ga_prod: 'paste ID here'

contrast_type

This optional setting allows you to change the type of contrast button your site uses. By default there are two buttons containing 'A'. If you use this option one single button will be displayed with the text 'High contrast' / 'Default contrast', depending on which mode of contrast is active.

contrast_type: long

create_goals

This optional setting can be used to automatically create the goal pages. Without this setting, you will need a file for each goal (per language), in a _goals folder. This setting should include another (indented) setting indicating the Jekyll layout to use for the goals.

create_goals:
  layout: goal

create_indicators

This optional setting can be used to automatically create the indicator pages. Without this setting, you will need a file for each indicator (per language), in an _indicators folder. This setting should include another (indented) setting indicating the Jekyll layout to use for the indicators.

create_indicators:
  layout: indicator

create_pages

This optional setting can be used to automatically create 4 platform-dependent pages:

  • the home page
  • the indicators.json page
  • the search results page
  • the reporting status page

Without this setting, you will need a file for each of these 4 pages (per language), in a _pages folder. This setting can include more advanced settings (see here) but can also simply be set to true.

create_pages: true

custom_css

This optional setting can be used to load additional CSS files on each page. It should be a list of relative paths to CSS files.

custom_css:
  - /assets/css/custom.css

custom_js

This optional setting can be used to load additional JavaScript files on each page. It should be a list of relative paths to JavaScript files.

custom_js:
  - /assets/js/custom.js

twitter

This optional setting creates a Twitter link in the platform's footer. It should be a Twitter account name.

twitter: MyTwitterAccount

facebook

This optional setting creates a Facebook link in the platform's footer. It should be a Facebook account name.

facebook: MyFacebookAccount

frontpage_heading

This optional setting can control the heading that appears on the front page.

frontpage_heading: Australian data for Sustainable Development Goal indicators

frontpage_instructions

This optional setting can control the instructions that appear on the front page.

frontpage_instructions: Click on each goal for Australian statistics for Sustainable Development Goal global indicators.

hide_empty_metadata

This optional setting can be used to hide any metadata fields that are empty. In other words, this setting can ensure that if an indicator has no data for a particular metadata field, that field will not display at all. The default behavior if for all metadata fields to be displayed, regardless of whether the indicator has the required data.

hide_empty_metadata: true

languages_public

This optional setting can be used if you are not happy with any of the standard language codes. For example, if the standard code for a language is xyz but you would prefer that it show up in your URLs as abc, then you could do the following:

languages_public:
  xyz: abc

metadata_tabs

This optional setting can control the metadata tabs which appear on the indicator pages. This is directly tied to the "schema" of your data repository (ie, the _prose.yml file). This keys of this object must correspond to the "scope" of the fields in that schema file. The following configuration is assumed if this setting is omitted:

metadata_tabs:
  national:
    title: indicator.national_metadata
    blurb: indicator.national_metadata_blurb
  global:
    title: indicator.global_metadata
    blurb: indicator.global_metadata_blurb
  sources:
    title: indicator.sources
    blurb: ''

About the "Sources" tab:

While the "keys" above, such as "national" and "global", are arbitrary, the "sources" key is special. The "Sources" tab will only display if the key under metadata_tabs is specifically sources.

non_global_metadata

This optional setting can be used to control the text of the tab containing non-global metadata. The default text is "National Metadata", but if you are implementing a sub-national platform, you could use "Local Metadata", or similar. Note that using a translation key is recommended for better multilingual support.

non_global_metadata: indicator.national_metadata

sharethis_property

This optional setting creates a ShareThis widget along the left side of every page. It should be the property id for your ShareThis account. For more information about this, see the sharing page.

Examples

To see many of these options in action, the site starter repository contains an example config file.