Koos
October 14, 2020, 8:28pm
1
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
rdyar
October 14, 2020, 11:20pm
2
did you read this recent post? might help.
Hey guys, I only recently started using Jekyll and really like it overall and was looking for a free way to add comments to my static blog posts and ended up doing it with Google Forms/Google Sheets.
I hadn’t really seen any posts about doing it this way so I wrote a little article about it here:
Let me know what you think about the approach! Or even if you have feedback on my writing, that’s always appreciated as well.
Thanks!
Koos
October 15, 2020, 5:25am
3
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
Koos
October 15, 2020, 12:52pm
4
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
printf
October 16, 2020, 3:24am
6
Not sure if this is relevant
Koos
October 16, 2020, 8:45am
7
Apparently airtable-ruby is no longer maintained either 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
1 Like