Including ORCID link in the footer of Jekyll Minima

Hello,

I am quite new to Jekyll, and I have a question about adding an additional (possibly custom) ‘social’ link at the bottom of my website.

I have a simple website using the minima theme of Jekyll, hosted on Github pages. I was wondering if there is a simple way to include your ORCID in the site’s footer, similar to how a Github, Facebook, or Twitter profile can be added by simply adding the corresponding username to the _config.yml.

According to the website, this would be done by included something like the following HTML on your page:

<div itemscope itemtype="https://schema.org/Person"><a itemprop="sameAs" content="https://orcid.org/0000-0002-8770-1429" href="https://orcid.org/0000-0002-8770-1429" target="orcid.widget" rel="me noopener noreferrer" style="vertical-align:top;"><img src="https://orcid.org/sites/default/files/images/orcid_16x16.png" style="width:1em;margin-right:.5em;" alt="ORCID iD icon">https://orcid.org/0000-0002-8770-1429</a></div>

there is a commonly used ORCID logo which looks like this: image, which is ideally suited for the minima theme’s aesthetic of having a small icon for each service (Twitter, fb, Github, etc). A lot of journals use this.

Ideally, I would just add something like ORCID: xxxx inside _config.yml and it would ‘just work’, but I’m willing to make a workaround if it’s easy to implement.

Has anyone tried to implement this?

Hi. Yes there is a pattern for this in minima.

Create a file in your repo to override the theme’s one. Copy the content of the theme social file.

_includes/social.html

Link to theme file.

Have a look at footer.html in the theme to see that getting called.

Then add a line after the last icon or whatever to add your own HTML.

Get your snippet to reference {{ social.orcid }}

Add a line to your config.

social:
  facebook: abc123
  orcid: 0000-0002-8770-1429
2 Likes

Thanks, this is very helpful! However, when I follow your instructions, my website stops displaying even the Github icon (which is the only one that currently gets displayed). It seems that the trouble is caused by using a snippet like this in my _config.yml:

social:
    github: emadmasroor

instead of what I had before, which was simply:

github_username: emadmasroor

This happens whether or not I put my own copy of social.html inside _includes, I don’t think this should make a difference since at this stage my social.html is identical to the theme default which you linked to in your post.

I doubt the ORCID icon will work unless I first figure out what I’m doing wrong at this step. Do you have any ideas?

Some more observations:

I think part of the problem here was that the file over at the Jekyll Minima repository called _includes/footer.html did not correspond to what is generated when I build my site without a custom _includes/footer.html. So, I did ctrl+u on my built web page and copied all the html past the <footer> tag into my local _includes/footer.html. Then, I added an additional column to this footer and in that column, I put {% include social.html %} after making a modified version of the original social.html, as you suggested. However, this does not work – nothing is rendered in that fourth column of the header!

I don’t know what’s up with that. I’ll try it locally now.

Okay I see the issue. My apologies - I didn’t know how much had changed in the social sections between the last Minima release 2.5.1 and the files on master which I had linked you to.

You had copied from the latest minima which expects social links like this:

You misunderstood how social.github was read. The social reference was just a reference to minima.social-links at social.html on master.


The approach you need to use in your config for Minima 2.5.1 is like this config.

e.g.

github_username: abc
orcid: 123

I’ve made a PR to fix your config, social.html file and delete footer.html :slight_smile:

I just merged all three of your pull requests. Thank you so much! You’re a star :star: :slight_smile:

On an unrelated note, I’ve been looking around on the internet for good templates of academic websites that I could learn from. Although I really love minima for its simplicity, it seems that this theme could be a good option. It uses a plugin jekyll-scholar, though, which isn’t supported by Github Pages’ automatic build process, and so the theme author has provided a script that can circumvent this restriction.

I do need to eventually migrate to something that can automatically generate a nicely-formatted bibliography from a *.bib file, and a theme which retains a minima-like aesthetic while implementing jekyll-scholar seems like a good idea.

Do you have any advice to offer?

1 Like

Edit: the _config.yml of that theme seems a bit daunting. Maybe this is not such a good idea at this stage…

I’m glad to see those merged and that it works for you.

Yes that theme has a long config including some stuff which you won’t want to change or won’t ever use. The theme also is not installable using a gemspec file in the root which means you have to fork the entire repo to use it. This is messy.

Ideally you find a theme with has a gemspec file or you make an issue to create one. Then you can install a theme like this without forking it.

If you are comfortable with Jekyll and that theme is overwhelming, you could use a site which installs the minima theme and then you add Jekyll scholar plugin yourself. You’d have to update some layouts and includes files maybe but you’ll have al-folio repo as a working reference.

Regarding custom deploys, I can see that the deploy scripts works fine. But it can only be run manually from your machine which is annoying if you like to edit and deploy using GitHub.

I can highly recommend Netlify.

As you just need a build command like

build: jekyll build

And it will install and use any custom gems. You even have to set any installs steps for Ruby or Bundler.

Then you serve a site on Netlify domain similar to GitHub Pages. Netlify points to your GH repo and builds on changes.

Also Netlify doesn’t need a gh-pages branch. It just builds from master or something and serves the outputted site directory which it stores internally.

You can also use GH Actions to build the gh-pages branch for you on commit or push, so you can keep using GH Pages.

I wrote a tutorial about this:

I also found a similar action which handles install and build only and then add an extra step to deploy. See the last section here

Thanks for the advice! At the moment, I think the minima theme rendered by Github pages works fine, but as my site becomes more complex I will probably need to migrate to a more flexible option. I will keep Netlify in mind, but I think I wouldn’t mind building locally and pushing the _site folder to a gh-pages branch.

I’m going to try and pare down al-folio to a manageable size, remove extraneous features, and experiment locally with it before I make the switch.

One more question: Can I use Github Actions to build the gh-pages branch if I’m using unapproved plugins like jekyll-scholar?

1 Like

Indeed. The tutorial linked above mentions that as the main selling point - you can use any gems you want to install whether plugins or themes.

And you can add ruby script to _plugins directory - normally GitHub Pages prevents that from running as potentially unsafe code.