Adding and Configuring Social Links- 2 mins
The Indigo theme allows users to maintain and display a selection of links to their social presence. A recent modification to this functionality makes configuring and maintaining these links, very easy.
Traditionally, a pre-defined set of social links were made available for the user to enable/disable, via the use of named configuration variables in
_config.yml, like so:
facebook: myfacebook twitter: mytwitter # google: mygoogle # instagram: myinstagram # pinterest: mypinterest linkedin: mylinkedin youtube: myyoutube spotify: myspotify github: mygithub email: [email protected]
Depending on which links were required, the user would un-comment (remove the ‘#’ symbol at the beginning of the line) specific lines of the config and replace the dummy names (myfacebook, mytwitter, etc.) with their actual IDs from each of the sites.
With the existing implementation, it was not very easy to add new links or re-order them on the home page. To make this process easier, the following improvements were made.
The manifest of social links was moved to a YAML formatted data file,
_data/social-links.yml, which stores the social site
url-scheme(e.g. https://) and
iconname (only required, if the
iconname was different from the social site
Here are some sample configurations:
- name: facebook url-prefix: facebook.com/ - name: twitter url-prefix: twitter.com/ - name: lanyrd url-prefix: lanyrd.com/ url-scheme: 'http://' icon: microphone - name: email url-scheme: 'mailto:' icon: mail
_includes/social-links.htmlfile iterates over the entries in
_data/social-links.yml, and makes use of the actual IDs configured in
_config.ymlalong with the icons in
_includes/icons.htmlto render the linkouts.
A new configuration variable called
_config.ymlallows the user to specify the explicit ordering of the linkouts (which overrides the listed order in
_data/social-links.ymlmanifest file). For example:
social-links-order: [github, facebook, twitter, medium, email]
These changes are fully backward compatible with the previous social link configuration set in
_config.yml. No changes are needed as long as you did not make modifications to your own
If you use the new
social-links-order variable, ensure that you add all the social media names to the list, otherwise they will not show up.
Additions for scientific users
For users in the scientific/academic fields who wish to link out to relevant resources that track their publication records, citation impact metrics, etc., Indigo now offers a set of scientific social linkouts to the following websites:
- Google Scholar