Pull Google Sheets Data Into an Eleventy Site #1418
Labels
documentation
needs-votes
A feature request on the backlog that needs upvotes or downvotes. Remove this label when resolved.
I figured out how to have a Google Sheet be used as a data source to populate an Eleventy rendered page. Once it is setup, you just need to edit the Google Sheet, run a bash script to download the Google Sheet JSON data, then run the Eleventy build.
entry
object before passing to the Eleventy data array to reduce the data complexity in the page template)data.my_data
data (njk file example from Skeleventy repo). This example assumes you have a Google Sheet with column header values ofLocation
,Name
,Description
,URL
. The JSON data presents the key values as all lowercase. You can uncomment the{{ myData | log }}
in the page template if you want to see the myData object in the console output during the build process. You can also access the data.my_data object from the template if you want to use that method.)This example renders the Google Sheet data on the page as follows:
The text was updated successfully, but these errors were encountered: