copy assets from newslettter

This commit is contained in:
Justin Cooper 2018-11-26 16:43:54 -06:00
parent f21fac5556
commit 645dc1febe
2 changed files with 11 additions and 8 deletions

View file

@ -17,4 +17,15 @@ task :copy_newsletter_posts do
File.write File.join(File.dirname(__FILE__), '../../_posts/', post["name"]), content
sleep 2
end
file = open('https://api.github.com/repos/adafruit/circuitpython-weekly-newsletter/contents/assets').read
assets = JSON.parse(file)
assets.each do |asset|
response = JSON.parse(open(asset["url"]).read)
content = Base64.decode64(response["content"])
File.write File.join(File.dirname(__FILE__), '../../assets/', asset["name"]), content
sleep 2
end
end

View file

@ -1,8 +0,0 @@
---
# Feel free to add content and custom Front Matter to this file.
# To modify the layout, see https://jekyllrb.com/docs/themes/#overriding-theme-defaults
layout: news
---
News Content