Welcome to my first post (or is it a page). This post is an experimental platform for me to learn how to blog. In addition, I am able to share my experiences with others who may find themselves walking down similar paths. First off, my blogging platform is powered by Octopress and it is being hosted by the github repository.
This article “How to Create a Post on Your Octopress Blog” shows how to set up and edit a post. It also demonstrates how to place certain wigits such as images, video and ‘code blocks’ onto the post. The follow up article “How to Configure and Edit Your Blog Site” shows how to change your blog’s appearance and add functionality.
Create a Post
Open a bash shell and type:
1
|
|
Create a new post: Blog posts are located in source/_posts. They follow a naming convention as: ‘YYYY-MM-DD-post-title.markdown’
1
|
|
EDIT THE POST FILE
Open the post file located in ‘source/_posts’ with your favorite editor. I am currently using gedit. The post file has header information in yaml. You may edit that information.
Categories are used to classify your post. Search Engines key off of them. You can place the categories in the side bar and you can filter your posts by category
1 2 3 4 |
|
Place Text
I have put some junk text that I thought was a comment at the bottom of this post. As I learn more, I will put at the top.
what is <! –more–!>
This tag tells the blog site where to stop showing your post. This way your older posts can show just the beginning paragraph which makes it easier to scroll down and see all of the older posts.
Place an Image
This is an example of how to place an image: (the image of the cat in the code block is not intended. I will find out how to prevent that later.
1 2 3 4 5 |
|
Resulting in:
I am having trouble placing all these cats around. I will learn how to heard these things as soon as I catch my breath.
If I want to link to an image from facebook, I have to right click on the image and copy image location. Then I can paste that link into my img tag.
Place a Video
If you want to place a video, its like so;
1
|
|
And here is how it looks.
Place Code Blocks (text boxes)
The text box below is essential to displaying code snippets. This box is pretty powerful due to it syntax highlighting. Thanks to Avinish Meetoo for the codesnip.
1 2 3 4 5 |
|
The box is coded as such:
1 2 3 4 5 6 7 |
|
You can include your own local snippets this way: File /home/mcarey/octopress/source/downloads/code/path/to/file could not be found . Hmmm, too much trouble at the moment. I am imagining that I would have to put my source under github. For now, what could be simpler than inlining the snippet as in the bottom example.
Another slick way to embed code snippets is with Gist. In this case we get a vdif file gistfile1.diff from the host GitHub.
Launch your Blog Locally or Globally
Open a bash shell and type:
1
|
|
To see your output blog, use these commands:
* ‘generate’ will generate your blog from source jekyll to html.
* ‘deploy’ will copy the generated files into the _deploy/ folder, then add them to git, commit and push them to the master branch.
* ‘preview’ will generate and launch a local web server at at ‘http://localhost:4000/’
1 2 3 |
|
To commit your source code into github, do the following.
1 2 3 |
|