Skip to content

Instantly share code, notes, and snippets.

@dylan-k
Created August 13, 2025 22:40
Show Gist options
  • Save dylan-k/1e2f41262471092319e79fb26a6652e5 to your computer and use it in GitHub Desktop.
Save dylan-k/1e2f41262471092319e79fb26a6652e5 to your computer and use it in GitHub Desktop.
Guide for presenting bibliography data with Jekyll

Presenting Bibliography Data with Jekyll

Using Jekyll static CMS, you can create an HTML5 Bibliography with Schema.org Metadata

  • Step 1: Create a bibliography
    Use Zotero, or whatever you like to create a bibliography. It shouldn't really matter what you use, so long as you can do...

  • Step 2: Create a JSON or YAML file that contains the bibliography

Most citation managers can export to json, and increasingly to cff a newer YAML-compatible file format for citations. You can also convert e.g. jsontoyaml.com

put your YAML in a file like biblios.yml in the _data directory (see also: http://www.madhur.co.in/blog/2013/11/05/makingmostdatadirectory.html)

  • Step 3: Create a Jekyll Template for Your Bibliography

Duplicate Jekyll's built-in "default.html" file in the _layouts directory. Name it something like biblio.html instead.

Then replace the line {{ content }} in the file you just created. Replace it with something like:

<main>
  {% for publication in site.data.publications %}
  <article itemscope itemtype="http://schema.org/CreativeWork">
    <meta itemprop="author" content="{{ publication.author }}" />
    <a href="{{ publication.URL }}" itemprop="url">
      <cite itemprop="name">{{ publication.title }}.</cite>
    </a>
    {% if publication.genre %}
      <span itemprop="genre">{{ publication.genre }}</span>.
    {% endif %}
    {% if publication.event_place %}
      <span itemprop="contentLocation">
        {{ publication.event_place }}
      </span>.
    {% endif %}
    <date itemprop="datePublished">
      {% for item in publication.issued %}
        {{ item | join: '-' }}
      {% endfor %}
    </date>.
  </article>
  {% endfor %}
</main>```

note: I wrote the above to configure the output according to my own needs, but yours may vary. You might want to tinker with the markup there, but there should be enough in this example to get you started.

Here are some resources that I found useful when learning how to write this:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment