Skip to content

Instantly share code, notes, and snippets.

@JayHoltslander
Created June 8, 2020 05:42
Show Gist options
  • Save JayHoltslander/bcc21e29ad1179f7b8354569ab5dddd4 to your computer and use it in GitHub Desktop.
Save JayHoltslander/bcc21e29ad1179f7b8354569ab5dddd4 to your computer and use it in GitHub Desktop.
This file when placed in 11ty's _data folder will fetch a Sheety API endpoint for use with 11ty
// Fetch external data for use with 11ty (https://www.11ty.dev)
const fetch = require("node-fetch");
module.exports = async function() {
console.log( "Fetching titles…" );
// Sheety API - See: https://sheety.co/
const response = await fetch("https://v2-api.sheety.co/fc583ad9266228c03ecc1ee9ace31835/starWarsChronologicalOrder/sheet1")
return response.json();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment