Jekyll configuration is stored at the root of the site repository in a YAML file called
_config.yml. General documentation about Jekyll configuration can be found in the official Jekyll documentation.
In addition to general Jekyll configurations, Open SDG needs some specific configurations. For more information on these, please see the configuration page.
As with any Jekyll theme, Open SDG can be easily customised. The platform comes with some out-of-the-box optional features that can serve as examples of possible customisations.
Optional feature: Goal page layouts¶
Open SDG includes two alternative layouts for the 17 goal pages:
goal- Indicators are displayed in a responsive grid
goal-by-target- Targets on the left, and indicators on the right
If you are using the
create_goals setting, you can change the layout as described on the configuration page in the "create goals" section.
Otherwise you can set the layout by adjusting the front matter of the goal file. For example, to use the goal-by-target layout, you would need this in the goal's front matter:
Working with (remote) Jekyll themes¶
This project (the repository you are reading currently) functions as a Jekyll theme, which can most easily be used with the help of the Remote Theme plugin. As with any Jekyll theme (and as can be seen in the folder structure of this project) the entirety of the theme is contained in these 3 folders:
Any file in these folders can be "overridden" simply by placing the same file in your site repository. When Jekyll compiles the platform, it will give precedence to files in your site repository, over the corresponding file in this remote theme.
In this way, any of the files in these folders can be customised to your platform's needs, without requiring any changes to the files in this theme.
NOTE on the
_sassfolder: Individual files in the
_sassfolder that start with an underscore (eg,
_maps.scss) cannot be overridden in the method mentioned above, unless you also override the open-sdg.scss file. This is a quirk of Jekyll's Sass implementation. Because of this it is recommended that you avoid overriding individual Sass files starting with underscores, and instead put your changes in a custom CSS file as detailed below.
NOTE: If you make an improvement that you think would be useful to others, please submit it as a pull-request in this repository!
_includes rather than
assets, as you might normally expect.
custom_js site configuration¶
The site configuration has a
scripts-custom.html include file¶
_includes/scripts-custom.html file can be overridden to contain any HTML you would like. This HTML is automatically placed close to the closing
Adding custom CSS¶
To add custom styles on top of the out-of-the-box Open SDG styles, it is recommended to put a
custom.scss in your site repository's
_sass folder. This has the effect of overriding this placeholder file in the starter repository.
Overriding color via Sass variables¶
In many cases, you may want to override the colors being used throughout the site. Rather than putting these types of changes in a custom CSS file (as mentioned above) a much simpler method is to override "Sass variables".
You can find a full list of Sass variables related to color in this Sass variables file.
By contrast to the method for overriding layouts and includes (mentioned above), overriding Sass variables can be done in a more easily-maintainable way. Instead of overriding the file containing the Sass variables, you instead override this placeholder file for Sass variable overrides. This allows you to override only the specific variables you need to change.