Upgrading to 2.1.0
This document is intended for developers, to help with the process of upgrading to version 2.1.0 of Open SDG, from 2.0.0 or higher.
Upgrade data repository to sdg-build 2.1.0¶
In your data repository, update your
requirements.txt file to:
Upgrade translations to sdg-translations 2.1.0¶
In your data repository's config file, update the version of sdg-translations in the "translations" section:
translations: - class: TranslationInputSdgTranslations source: https://github.com/open-sdg/sdg-translations.git tag: 2.1.0
Update version of Open SDG to 2.1.0¶
In your site repository's
_config.yml file, update the version of Open SDG in
remote_theme, like so:
Update version of jekyll-open-sdg-plugins to 2.1.0¶
In your site repository's
Gemfile, update the version of jekyll-open-sdg-plugins like so:
gem "jekyll-open-sdg-plugins", "2.1.0"
Updating overridden files¶
If you are overriding certain files, you may need to adjust your version in order to benefit from the latest features, bugfixes, and design changes. If you are unsure, check the
_layouts folders in your site repository. If they contain any of the following files, you may want to incorporate the latest changes into your overrides. The links below will show you the exact changes for each file.
Note that we strive to avoid any breaking changes, so this process of updating overridden files is optional. However we strongly recommend keeping your overridden files as current as possible.
New features for the indicator metadata section¶
This release introduces some optional features that you may be interested in adding to your platform. The following are all related to the metadata section on indicator pages.
Normally when an indicator has no content for a metadata field, Open SDG will display the field label without any content. One way to avoid this is the
hide_empty_metadata site configuration, which can be used to hide empty fields altogether.
As of version 2.1.0, if you are not using
hide_empty_metadata, fields without content will display a placeholder instead which is controlled by the new site configuration
empty_metadata_placeholder (by default it is "Not available for this indicator"). Here is the documentation for `empty_metadata_placeholder.
This is similar to
empty_metadata_placeholder above, but it is used instead in the "Sources" metadata tab.
Open SDG has always had a mechanism for displaying multiple "sources" by using metadata fields like
source_active_2, etc. While this method is still supported, there is an alternative solution now, in the
sources indicator configuration which you may prefer to use instead. One benefit of this approach is that it has a dedicated field for an image, which will display at the top of each source.
Open SDG now has functionality for displaying a "Related indicators" tab in the metadata section on indicator pages. Here is the documentation on how to use the
related_indicators indicator configuration.
Similarly, Open SDG now has functionality for displaying a "Publications" tab in the metadata section on indicator pages. Here is the documentation on how to use the
publications indicator configuration.
Subheading for goal pages¶
If you would like to add the same subheading (such as "About this goal") on each goal page, you can use the new
goal_content_heading property in the
create_goals setting. For example, if you would like to have "About this goal" appear as a subheading on each goal page, you use can something like this for your
create_goals site configuration:
create_goals: goal_content_heading: About this goal previous_next_links: true goals: - goal: 1 content: My content for goal 1 - goal: 2 content: My content for goal 2