Closed omarciovsena closed 4 years ago
Hi, no it is not possible, but you can achieve the same result by downloading the json file first, for instance using curl. Notice that the data would be read, in any case, at build time, so I am not sure whether there is a use case which I am missing, here.
Thanks for the answer. I solved it with a script that generates the files in the build in the application.
data = JSON.load(URI.open('https://example.json'))
array = data["members"]
path = './members/'
if array && !array.empty?
array.each do |entry|
File.open(File.join(path + entry['username'].to_s + ".md"), 'wb') do |opp|
opp.puts("---")
opp.puts("layout: opportunity")
opp.puts("id: #{entry["id"]}")
opp.puts("name: #{entry["name"]}")
opp.puts("stacks: #{entry["stacks"]}")
opp.puts("description: #{entry["description"]}")
opp.puts("\n---")
end
end
end
@marciovsena https://github.com/brockfanning/jekyll-get-json
is it possible to make a request in a remote json file?