Snippets

Nicola Paolucci Bash alias to create new DAC post

Created by Nicola Paolucci last modified
  function new_post {

    NEW_POST_TITLE="$(echo $@ | sed -e "s/ /-/g")"
    NEW_POST_DIR="$HOME/p/developer.atlassian.com/app/posts/$(date +"%Y/%m")/$NEW_POST_TITLE"
    mkdir -p  $NEW_POST_DIR
    cat >> $NEW_POST_DIR/index.md << "EOF"
---
title: "Title"
date: "2015-MM-DD 06:00"
author: "author"
categories: ["cat1","cat2"]
---

## Conclusions

In any case if you found this interesting at all and want more why not follow
me at [@durdn] or my awesome team at [@atlassiandev]?

[@atlassiandev]: https://www.twitter.com/atlassiandev
[@durdn]: https://www.twitter.com/durdn
EOF
    echo "Created: $NEW_POST_DIR/index.md"
    git checkout develop
    git checkout -b blog/$NEW_POST_TITLE
    git add $NEW_POST_DIR/index.md
  }

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.