This was a somewhat quick project for this sunday.
With the App 4K stogram I downloaded all my photos from instagram. The program saves each file with time and date in the filename. So I placed each one of them in a folder, changing spaces to underscores in the filenames and ran the small script bellow to magically create the posts. I saved my files in content/instagram, keep that in mind if you use the script.
for dir in *; do date=`cut -d'_' -f 1 <<< "$dir"`; file=$dir'.jpg'; time=`cut -d'_' -f 2 <<< "$dir" | sed -e 's/\./\:/g'`; datetime=$date'T'$time'+00:00'; printf '%s\n' '---' 'categories: ["instagram"]' "date: $datetime" 'description: ""' 'draft: false' "featured_image: /instagram/$dir/$file" 'layout: post' 'slug:' 'stories:' 'subtitle:' 'title: Untitled' '---' '' "<img src=\"$file\" />" > $dir/index.md ; done
This was later turned into a section, with it’s own layouts and minor tweaks.