-
-
Notifications
You must be signed in to change notification settings - Fork 681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create import-google-sheets-data.md #784
base: main
Are you sure you want to change the base?
Conversation
You can use a Google Sheet as a data source to populate an Eleventy rendered page. My use case is a community edited Google Sheet, that can then be simply pulled into a static web site and rendered into a web page using Eleventy templates.
I like this but can you use a markdown code block (the triple ```) instead of a remote image for the sample output? |
Replaced remote image with markdown, to represent rendering results
@zachleat Open it again! Sheets v4 API can be used, see here https://developers.google.com/sheets/api/guides/migration Instead of publishing the sheet on the web, you just create a API KEY in Google Console and pass it to the URL. Like this: https://sheets.googleapis.com/v4/spreadsheets/[[your-spreadsheet-id]]/values/Sheet1?key=[your-api-key] Just tested and got the following output:
|
@crockwave are you still available to update this PR using the new sheets API? |
The web site I created this for is going out of service. I don't have a current application for this. I examined Google Sheets API V4 and was able to successfully run a sample GET on one of my sheets, but had to use OAuth rather than the general purpose API key that I generated. That GET returned JSON data. https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/get As long as you can generate an updated JSON data file before compiling your site, you should be able to accomplish the use case of a community edited Google sheet that is the data source for an Eleventy compiled static page |
You can use a Google Sheet as a data source to populate an Eleventy rendered page. My use case is a community edited Google Sheet, that can then be simply pulled into a static web site and rendered into a web page using Eleventy templates.