How to pull in data from a web-based spreadsheet (GSheet, Airtable)?

There’s the jekyll-airtable_data plugin to pull in data from Airtable, but it doesn’t seem to work with the current Jekyll version. Downloading a Google Sheet as CSV with curl/wget no longer seems to work. I found the jekyll-gdrive plugin to pull in data from Google Sheets, but it’s no longer maintained. The documentation says "Once you have the token, you need to set it up as an environment variable before running jekyll build" but I don’t know where to set it.

Has anyone here been successful with this?

1 Like

did you read this recent post? might help.

Yes, as far as I can tell, that post shows how he pulls in Google Sheet data with JavaScript. I want to import it into Jekyll.

1 Like

Downloading a Google Sheet via curl doesn’t seem to work anymore. But I found that Airtable also offers a download option for each table:

curl -o _data/my_table.json https://api.airtable.com/v0/appuB4YjkdgtWYW1e/links \
-H "Authorization: Bearer YOUR_API_KEY"

This downloads a JSON file that Jekyll can handle perfectly fine. I still have to figure out how to automatically run that line when I do bundle exec jekyll serve.

Yes you can use curl to store JSON in data directory and then run Jekyll serve.

You can do that on GH Pages unless you use GH Actions.

I find Netlify is way lighter. no need for setting up a workflow or choosing an action or giving it a token.
Just configure

[build]
  command = "./download_sheet.sh && bundle exec jekyll serve"

Assuming the curl command is a bash script to make the config lighter and so you only have to write the curl line in one file.

You don’t even have to run install as Netlify does it for you


Not sure if this is relevant

Apparently airtable-ruby is no longer maintained either :grimacing: Airrecord is supposed to be an alternative, but I don’t know how to integrate it with Jekyll.

I’m using a simple bash script for now:

curl -o _data/my_table.json https://api.airtable.com/v0/appuB4YjkdgtWYW1e/links \
-H "Authorization: Bearer YOUR_API_KEY"
bundle exec jekyll serve --config _config.yml,_config_dev.yml

This pulls in the data from Airtable and then starts the dev server. It doesn’t do live/polled updates from Airtable, but this is fine.

Thanks I kept running into an issue w/ it and I guess this is my answer :sweat_smile:

1 Like