octopress blog daily cheat sheet · modius.io

octopress blog daily cheat sheet

25 Mar 2013

Assumes you have a fully functional Octopress blogging environment. This cheat sheet is a one page reminder of how to generate a blog post, and the markup for the default plugins.

Working with Blog Posts

Create a new blog post

$ rake new_post["Zombie Ninjas Attack: A survivor's retrospective"]
# Creates source/_posts/2011-07-03-zombie-ninjas-attack-a-survivors-retrospective.markdown

Save your source files

$ git add .
$ git commit -m 'your message'
$ git push origin source

Publish to live site

$ rake generate   # Generates posts and pages into the public directory
$ rake deploy     # Pushes it to your GIT master for publication

Other options

$ rake watch      # Watches source/ and sass/ for changes and regenerates
$ rake preview    # Watches, and mounts a webserver at http://localhost:4000

Excerpt

Create a teaser using <!-- more --> where you want the "Read More" button.

Working with DRAFT posts

Just don't $ rake deploy or use published: false in post header.

Markup

Generally its Markdown.

Code blocks

Backticks

    ``` [language] [title] [url] [link text]
    code snippet
    ```

Some language options: java, js, cfm, apacheconf, sql. Complete list of Pygments Lexers

Gist blocks

    { % gist gist_id [filename] %}    # Syntax (no spaces in liquid templates)
    { % gist 996818 %}                # Example

Image

Image embed

{ % img [class names] /path/to/image [width] [height] [title text [alt text]] %}
{ % img http://placekitten.com/890/280 %}

Quotes

Formatted block quote

{ % blockquote [author[, source]] [link] [source_link_title] %}
Quote string
{ % endblockquote %}

Inline pull quote

{ % pullquote %}
Surround your paragraph with the pull quote tags. Then when you come to
the text you want to pull, { " surround it like this "} and that's all there is to it.
{ % endpullquote %}

This is a companion discussion topic for the original entry at http://modius.io/2013/03/25/octopress-daily-cheat-sheet/