Skip to content

Write a blog post for the SHOGun blog

Christian Mayer edited this page Apr 6, 2014 · 2 revisions

Clone the gh-pages branch

First of all you need a clone of the gh-pages branch of the SHOGun project. You can do this with the git commandline tool, for example

git clone -b gh-pages https://github.com/terrestris/shogun

Creating the post file

Every post has to be in its own file and has to be located in the _posts folder of the gh-pages branch (more information on the folder structure). By the naming convention of the jekyll framework the file has to be named like this:

YEAR-MONTH-DAY-title.MARKUP

for example

2014-04-06-my-new-blogpost.markdown

Adding the post content

All blog post files must begin with YAML front-matter. This is YAML formatted block providing meta information about the blog post. At least these information have to be provided:

---
layout: post
title: This is my new blog post
---

For more information take a look at the YAML front-matter documentation.

After the YAML front-matter block you can write the content of your blog post in Markdown Syntax. Github Pages will automatically transform the markdown to HTML.

An example for a valid post file:

---
layout: post
title: This is my new blog post
---
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut 
labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores 
et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. 
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt 
ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo 
duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum 
dolor sit amet.

More information about writing posts with jekyll can be found here

Publishing posts

To publish the created post the normal git/github machanism will be used. You just have to push the post file hosted in the _posts folder to the gh-pages branch of the origin (normally the SHOGun github-project) as you are a SHOGun core developer. Since you are not a core developer of the SHOGun project you will have to provide a pull request, which includes your post. After a positive review of a core developer the post will be published by merging the PR to the gh-pages branch.

Since your blog post has been published it will be linked at http://terrestris.github.io/shogun/blog.html or you can access ist directly by the URL pattern:

http://terrestris.github.io/shogun/yar/month/day/title.html

for example (according to the example above):

http://terrestris.github.io/shogun/2014/04/06/my-new-blogpost.html