my own rake tasks for faster post creation

seems i got it too work. i needed a faster way to create posts with a simple command on the command line: rake post["title"]

in a _post.txt file i can define the yaml front matter for the specific post and the rakefile takes care of the title and date of the post and generates the file inside _posts/.

in the _config.yml i add the lines:

post:
  template: _post.txt
  extension: md

i can add different tasks for different post types which could have different front matter if needed. booya.

oh yeah, i could start using Octopress, cus it’s awesome but i’m trying my own ways first, aight…

how this shit works.

so… basically this is it:

  • make sure u have node_modules in your .gitignore
  • set markdown syntax to kramdown in your _config.yml
  • run npm install to grab all dependencies from your package.json
  • run gulp to open up localhost:3000 and start editing what u need
  • if all is ok, just commit to the repo and sync.

but…

if you have all repos saved locally and up-to-date (that is, working on one comp), then u don’t need to install gulp locally every time. branches are easy since they work on the same files. tadaa.

Welcome to Shitforbrains

You’ll find this post in your _posts directory - edit this post and re-build (or run with the -w switch) to see your changes! To add new posts, simply add a file in the _posts directory that follows the convention: YYYY-MM-DD-name-of-post.ext.

Jekyll also offers powerful support for code snippets:

<h1>header</h1>
<p>apa in a paragraph</p>

Check out the Jekyll docs for more info on how to get the most out of Jekyll. File all bugs/feature requests at Jekyll’s GitHub repo.