Bringing Zotero to Ghost

Bringing Zotero to Ghost

The blogging platform Ghost.org has been around for a few years now, bringing a welcome gust of fresh air in the world of blogging infrastructure dominated by the WordPress juggernaut. Ghost is designed to focus on content, a place where you write and read and enjoy doing it, reducing the administrative overhead of blog-keeping. Ghost runs on node.js a technology for the web with hight rates of innovation and creativity. Ghost doesn’t have the incredibly rich and diverse ecosystem of plug-ins that make WordPress flexible and powerful. But that is precisely the point: to focus on writing, enjoy the pleasure of reading from neat, uncluttered themes, without worrying about the rest. Ghost is faster than WordPress, using less resources on your server and yes and the end of the year consuming less energy (I stress-tested two blogs with exactly the same content running on the same Debian server with apache benchmarking and Ghost is ten times faster than WP). Ghost is cool.

And in case there is that little function that Ghost does not provide out of the box, but you would really like to have, a few lines of code can do the task.

For those into research and academic writing using bibliography and citation managers, it is important that even a blog post can be cited correctly. Ghost exposes some metatada for this purpose, but not a complete set following one of the prevailing open standards like COinS (http://ocoins.info), unAPI etc.

I’ve been using Zotero.org the great, free and open-source bibliographic manager, for the last ten years or so. Please note that Zotero has the additional bonus that it does not spy on you sending the information about your collections and reading habits to some publishing corporate server. Hence, I was interested in having Ghost-based blogs to expose standard metadata for a proper bibliographical indexing.

I could not find a direct reference for Ghost but Matthew Lincoln explains how to add COinS metadata to a Jekyll-based blog.

Taking Lincoln’s cue I first exported one of my existing Zotero references to COinS to compare its structure with Lincoln’s code snippet.

Then I adapted it to Ghost’s own system of referencing variables, ending up with this snippet:

<span class='Z3988' title='url_ver=Z39.88-2004&ctx_ver=Z39.88-2004&rfr_id=info%3Asid%2Fzotero.org%3A2&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Adc&rft.type=blogPost&rft.title={{@title}}&rft.source=Security%20Praxis&rft.identifier={{@blog.url}}{{url}}&rft.au={{author.name}}&rft.date={{@date}}&rft.language=English'></span>

which I inserted in the body of the file post.hbs in the current Ghost theme (based on Casper).

Now the Ghost blog exposes correctly the author, title, publication, type of publication using the COinS standard and each post can be entered into Zotero collections using the usual click on the “Z” icon in your browser (tested on Firefox and Safari).

 

Acknowledgments

Cover photo: Source: Rayward, W. Boyd (2010): Mundaneum: Archives of Knowledge. Graduate School of Library and Information Science University of Illinois (Occasional Papers 215). Via: Philipp Messner, Universal Bibliographic Repertory, The Universal Bibliographic Repertory at the International Office of Bibliography in Brussels in 1907 https://flic.kr/p/9tbdiM

Read more