Access a Google Drive Spreadsheet from your Jekyll templates
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Jekyll Gdrive Plugin

Access data from a Google Drive Spreadsheet in your Jekyll sites


Add these lines to your Gemfile:

group :jekyll_plugins do
  gem 'jekyll-gdrive'

And then execute:

$ bundle install


Before you can access any data from GDrive you need to configure your GDrive API credentials. After installing the plugin, run:

$ bundle exec jekyll gdrive

And follow the instructions to create an application in Google's developer console and generate a refresh token.

Once you have the token, you need to set it up as an environment variable before running jekyll build. The GDrive plugin will give you an export statement you can use to setup your environment:

$ export GDRIVE=<client_id>:<client_secret>:<your gdrive token>

You'll also need to configure the plugin to use the right spreadsheet.

Add this to your _config.yml:

  sheet: "title of my spreadsheet"

Accessing your Google Sheet data

In any Liquid template you can now use: to access your sheet data.


      {% for row in limit:1 %}
          {% for col in row %}<th>{{col}}</th>{% endfor %}
      {% endfor %}
      {% for row in offset:1 %}
          {% for col in row %}<td>{{col}}</td>{% endfor %}
      {% endfor %}  


Google's Drive API is not incredibly fast. When working in jekyll serve --watch mode you'll quickly get tired of waiting for the spreadsheet data to load on every refresh.

To work around this you can specify a cache period for the gdrive plugin in the Jekyll configuration:

   sheet: "My sheet"
   cache_period: 5 minutes

This will store the sheet in a local _gdrive_cache file and only reload the sheet data once every 5 minutes.

You can specify the time in seconds, minutes or hours.


  1. Fork it ([my-github-username]/jekyll-gdrive/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request