johnkors

John Korsnes

Useful Octopress Commands

| Comments

GitHub Pages is awesome. Octopress makes it even MORE awesome.

A small list of useful commands for making blog posts using Octopress.

The following commands are the once I use to make changes to the GitHub Pages (user verison, not the pr project version) blog.

Okay. So the starting point should always be from the git branch named source in your Octopress directory. Verify that. Next up:

Creating a new blog post Octopress docs
1
rake new_post["title"]

This will generate a markdown file in the source\\_posts\\ folder. This is were put your content. Edit this with whatever content using the markdown syntax. The next step is to publish this to the publicdirectory (locally):

Pushing from source to public directory Octopress docs
1
rake generate

To do a local preview of your post, use :

Local preview Octopress docs
1
rake preview

This will launch your local web server at the port (default 4000, but you may configure this in the Rakefile).

When you are happy with the output of your blog post, you may commit the changes to the source branch and push the changes to GitHub (the origin remote).

Commiting a blog post to Git and GitHub Octopress docs
1
2
3
git add .
git commit -m 'new fancy blog post about octopress'
git push origin source

This has not published anything - only stored your source changes to Git & GitHub. To actually deploy the changes you made to the public directory with the rake generate task, do

Publish public directory Octopress docs
1
rake deploy

For Octopress to work correctly, always use the rake deploy command. The Rake Deploy will push the public folder to your master branch on GitHub.

Comments