Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save bugsysop/2b8ab4628e1cd9f8ebdced4a38f9574f to your computer and use it in GitHub Desktop.

Select an option

Save bugsysop/2b8ab4628e1cd9f8ebdced4a38f9574f to your computer and use it in GitHub Desktop.

Revisions

  1. @brunoamaral brunoamaral renamed this gist Nov 27, 2018. 1 changed file with 0 additions and 0 deletions.
  2. @brunoamaral brunoamaral created this gist Nov 27, 2018.
    10 changes: 10 additions & 0 deletions buil-page-bundles-for-instagram.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    for file in *
    do
    date=`cut -d' ' -f 1 <<< "$file"`
    dir=${file%".jpg"}
    mkdir "$dir"
    mv "$file" "$dir"
    time=`cut -d' ' -f 2 <<< "$file" | sed -e 's/\./\:/g'`
    datetime=$date'T'$time'+00:00'
    printf '%s\n' '---' 'categories: ["instagram"]' "date: $datetime" 'description: ""' 'draft: false' 'resources:' " - src: '$file'" ' name: "header"' 'layout: instagram' 'slug:' 'stories:' 'subtitle:' 'title: Untitled' 'options:' ' unlisted: false' ' showHeader: true' '---' '' "<img src=\"$file\" />" | tee $dir/index.md $dir/index.pt.md
    done