Skip to content
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

Pass in a custom fetching function rather than a URL #23

Closed
AleksandrHovhannisyan opened this issue Apr 27, 2022 · 2 comments
Closed

Pass in a custom fetching function rather than a URL #23

AleksandrHovhannisyan opened this issue Apr 27, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@AleksandrHovhannisyan
Copy link

AleksandrHovhannisyan commented Apr 27, 2022

Howdy! I think it would be really nice if I could pass in a function that fetches my data from the target URL, rather than passing in the URL directly. For my use case specifically, I want to pull in data from the GitHub API at build time using their Octokit helper library. It's definitely possible to make requests by hand by assembling a request URL, but it's not as ergonomic (plus, Octokit allows you to aggregate paginated calls without needing to do this yourself). Is this something this plugin could accommodate? Maybe it would just need to accept a user-supplied key for caching since it's no longer getting a URL directly.

@carbontwelve
Copy link

I think implementing this would provide a solution to #2.

@zachleat zachleat added the enhancement New feature or request label Mar 17, 2023
doug-wade added a commit to doug-wade/eleventy-fetch that referenced this issue Jul 10, 2023
doug-wade added a commit to doug-wade/eleventy-fetch that referenced this issue Jul 10, 2023
doug-wade added a commit to doug-wade/eleventy-fetch that referenced this issue Mar 9, 2024
@zachleat zachleat added this to the Eleventy Fetch v5.0.0 milestone Oct 22, 2024
@zachleat
Copy link
Member

Merged #32—thank you @doug-wade!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants