Adding to a GitHub Pages site

Image by Michael Coghlan. Available on Flickr.

By Niall Beard, University of Manchester. is a mechanism for explicitly annotating site content so that search engines can better understand what your website contains. Applying it to your site improves its search rank results improving its discoverability.


As with any site nowadays; you’re competing in a crowded market-place. Ranking higher on search result pages or being included in 3rd party registries that receive more web-traffic can raise the exposure of your work to be seen by larger audiences. This is all achievable by following best practices and applying to your site.

It doesn’t matter what your website has on it - biological datasets, training resources, software tools, film stars - describing them using will enhance your sites presence in search engine results, and it will allow your site to be indexed in aggregated registries (such as ELIXIR TeSS for training, or for tools and databases).

What? is a collection of specifications (called vocabularies) that are used to define in a structured way what is being displayed on a web page. Search engines are in the business of understanding websites content so they can more effectively direct the searcher to their desired location. They would normally consider a page relevant to a user if words in the query match words within the document (with some fancy algorithms applied on top). gives page owners a mechanism to explicitly define what content they have in their page, which removes the necessary guess-work from the search engines and raises their certainty that the user in fact wanted to know something contained within this page.

Organisations such as also create profiles over the vocabularies to describe specialised resources using to make scientific assets more findable and interoperable.

GitHub Pages are an excellent platform for creating informative websites. The hosting is (currently) free which is a huge plus; the collaborative tools allow teams (that may be widely distributed, quickly changing, or voluntary) to contribute in a well-structured, verifiable, and open manner; and the version control capabilities are incredibly useful throughout development. It’s becoming a popular choice to make websites with.


This guide will show you how to do add to GitHub Pages. can be applied to any online page made using any tech-stack but due to Jekyll (the underlying tech being Github pages) being a very clear, simple, and increasingly popular framework; this tutorial follows the process using Github pages.

If you do not already have a website, you can follow this guide about setting up a GitHub Page to configure the correct development environment and set one up.

For this example we’ll add to a Training Materials site.

To follow along; set up a new jekyll app by running jekyll new my-tutorial and matching the file structure below.

Create a new folder called tutorials which will contain your training materials. Create a new folder called _layouts which will contain a template page structure.

├── 404.html
├── Gemfile
├── Gemfile.lock
├── _config.yml
├── _layouts
│   └── tutorial.html
├── _tutorials
│   └──

Lets create our first tutorial called in tutorials. In each of our tutorials, we’ll define the content of the page in Markdown syntax at the bottom of the file, and add all the metadata describing it above.

Open and add the metadata. Jekyll allows you to put metadata at the top of markdown files in YAML syntax. This metadata must be surrounded by 3-hyphens above and below.

layout: tutorial
 "@type": CreativeWork
 about: "This is a training material about"
   - "@type": Audience
     name: WebMaster
 genre: "Tutorial"
 name: "Adding to your website"
 author: ["Fred Dibnah", "Niall Beard"]
   - "@type": Person
     name: "Frank Spencer"
 description: "In order to establish higher search results for online resources"
 keywords: ["schemaorg", "TeSS"]
 license: CC-BY 4.0
 version: 1.0

### My Awesome Tutorial

This is my tutorial. It's great because

- It's free
- It's on Github Pages
- It's got

Here we define how to render the page, what metadata to use, and what the page content should be.

The first two properties specifiy which vocabulary we are using - the CreativeWork vocabulary ("@type": CreativeWork) from ("@context":

You will use a different schema type depending on which vocabulary you are describing (e.g. "@type": Event for events, "@type": Website to describe what your website is, or "@type": Recipe to describe a potato salad)

Underneath, we have a list of key-value pairs. Each key is a property of the CreativeWork vocabulary. The full list of properties, the expected types, and examples on how to use them are all available on vocabulary pages in

We’ve also added layout: tutorial to our YAML. This tells Jekyll (the underlying framework) that this page should be rendered inside the HTML template tutorial.

We created a new folder called _layouts and have a new empty file called tutorial.html inside. This is where our template will be. Open tutorial.html and add the following:

<!DOCTYPE html>
     <script type="application/ld+json">
        {{ page.schemadotorg | jsonify }}
    {{ content }}

This will be the basic layout of on any page that specifies layout: tutorial in its YAML. The content unique to each page will be injected where the {{ content }} tag is. This is where our Markdown from earlier will be rendered into HTML.

To render our we pass the schemaorg metadata to a function called jsonify. This will convert our YAML metadata into JSON-LD - which will form our completed annotation!

This function first needs to be installed. Open the file Gemfile in the root directory and add the following lines:

source ""
gem "jekyll", "~> 3.7.3"

group :jekyll_plugins do
 gem "jekyll-json-ld"


Perfect! Now run bundle install to install the jekyll-json-ld gem. (see step 2.5) Then, start the Jekyll server with jekyll serve and navigate to in your browser (see step 4).


On your tutorial page, right click and view the page source.

If all is well, you should see JSON-LD data inside the HTML. To test whether this is formatted correctly, you can then go to Google structured data testing tool and copy the HTML in.



Once you have created a website that is publicly available online and has correctly formatted JSON-LD, you can go to the Google Search Console and see more statistics about what and how Google interprets the data on your site.

In the Search Console you can request re-indexing when your is setup, view the error rates, and see how people are finding and using your site.


Making better use of the metadata

If you change anything about your training material, you would have to change both the material and the metadata. But one of the advantages of structuring data into a machine readable format is data becomes very accessible and re-usable.

So instead of duplicating information, we should use the metadata to form the view that website users see. Go back to _layouts/tutorial.html and add some more template code to render the metadata variables within the HTML.

<!DOCTYPE html>
     <script type="application/ld+json">
        {{ page.schemaorg | jsonify }}
    <h1>{{ }}</h1>
       by {{ | join: ' and ' }}<br>
       <i>{{ page.schemaorg.about }} </i><br>
       This tutorial is aimed at:
      {{ content }}