-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Add remote support to resources.Get #9185
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
Conversation
|
One example use case is the RSS/XML feed parsing as discussed in #9044 another use case could be the generation of Open Graph images (in this case using https://bruzu.com): {{- $image := resources.FromRemote ( print "https://img.bruzu.com/?" (querify
"bi" "https://example.com/img/og-background.png" "h" "627" "w" "1200"
"a.oy" "top" "a.ox" "left" "a.x" "100" "a.y" "100" "a.w" "1000" "a.h" "68" "a.c" "#ffffff" "a.ta" "left" "a.fs" "40" "a.lh" "1" "a.fw" "900" "a.ff" "Roboto" "a.maxHeight" "120"
"b.tp" "textbox" "b.x" "100" "b.y" "200" "b.w" "1000" "b.h" "244" "b.oy" "top" "b.ox" "left" "b.c" "#ffffff" "b.ta" "left" "b.fs" "20" "b.lh" "1.2" "b.fw" "400" "b.ff" "Roboto" "b.ox" "left" "b.oy" "top" "b.maxHeight" "250"
"a.t" .Title
"b.t" .Summary
)) -}}
<meta property="og:image" content="{{ $image.Permalink }}" /> |
|
Addressed the comments and implemented options, you can now specify the request headers in the options, optionally combined with a request method and body (see also related issue #7699). |
|
I will merge this once the tests go green, it looks very good, I really like how the API turned out. |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Implement resources.FromRemote, inspired by #5686
Closes #5255
Supports #9044