Adding a citation system

by Richard Vale in 
jekyll

I recently found a useful tutorial on AWS S3 in R at a blog called Notes from a Data Witch. One thing I liked about this blog is that includes a BibTeX citation for each post in case a reader wants to copy and paste the citation information. Some students at Auckland University recently told me that they have been using my DSGE tutorial so I decided that it would be a good idea if I had a citation system too.

To implement the system, I simply added the following lines to my post.html file in the _layouts directory.

{% if page.citable == true %} 
<div style="font-size:70%; color:#D3D3D3;">
  {{author.surname}}, {{author.name_short}}, {{ page.date | date: "%Y" }}. "{{ page.title }}", 
  {{ page.date | date_to_string }}. {{ page.url | absolute_url }}
</div>
{% endif %}

This piece of code prints the author, date and URL, but only if the citable flag is set to true. For most posts (like this one) I don’t set it at all, and then the citation option does not appear.

I also created a separate piece of code to print the BibTeX citation. It mostly works, but I couldn’t find a way to put curly braces around the capital letters in the post title. I think it can be done with a regex in jekyll but I couldn’t get it to work, so if someone can help with that, please let me know!

So if you find something useful on this site, feel free to cite it! After all, if academics aren’t taking enough risks in their research, then maybe blogs have a role to play too?

© Data Science Confidential 2026 All rights reserved.