Adding and Configuring Social Links
Adding and Configuring Social Links
- 2 minsSummary:
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.
Index
Background
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: myemail@gmail.com
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.
Once enabled, the _includes/social-links.html
file would rely on the configs and display the corresponding set of links along with icon assets from _include/icons.html
.
Improvements
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 sitename
(e.g. facebook),url-prefix
(e.g. facebook.com/),url-scheme
(e.g. https://) andicon
name (only required, if theicon
name was different from the social sitename
).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
-
The updated
_includes/social-links.html
file iterates over the entries in_data/social-links.yml
, and makes use of the actual IDs configured in_config.yml
along with the icons in_includes/icons.html
to render the linkouts. -
A new configuration variable called
social-links-order
in_config.yml
allows the user to specify the explicit ordering of the linkouts (which overrides the listed order in_data/social-links.yml
manifest file). For example:social-links-order: [github, facebook, twitter, medium, email]
Compatibility
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 _includes/social-links.html
.
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
- ResearchGate
- Mendeley
- PubMed
- ORCiD
- Impactstory
- figshare