Welcome to the CoderDojoDC website source code (the site itself is hosted by github pages, generated via Jekyll).
So you want to create a new post? This probably happens a lot... The easiest way is probably to copy the content from an existing file in the _posts
directory and create a new file with an appropriate YYYY-MM-DD-url-to-page-usually-post-title.md
name.
The YAML front-matter includes some specifications for the post, including the layout template that should be used, the title, the date, some tags (an array of strings), and anything else you want to store up there. The bare minimum for a post is layout
, date
, and a title
. It looks like this in one example:
---
layout: post
title: Making progress!
date: '2012-12-04T10:45:00-05:00'
tags: []
tumblr_url: http://coderdojodc.com/post/37190285749/making-progress
---
Here are the jekyll instructions.
The format for post itself is done in markdown
You can include code samples and block quotes with the special syntax, like so:
{% highlight python %}
def foo(t):
print("this is highlighted")
{% endhighlight %}
> Here's a quote
> by someone...
Github does this automatically when someone commits a change to the master
branch of the CoderDojoDC/CoderDojoDC.github.io
repository.
Jekyll generates static pages based on the markdown and html template code of all files with supported extensions (typically .md, .markdown, or .html) that have YAML front-matter. You can do this manually, see below.
Jekyll uses the liquid templating language, and github pages gives us some stuff out of the box, along with limited plugin support, see here for github's pages documentation:
You'll want to look at the _layouts
directory for the default.html
template (used in most pages). Files with an .html
extension likely also include some templating.
This works for Mac OSX and Linux
- Install rvm
- Install ruby 2.1.1 with:
rvm install 2.1.1
- Install bundler (probably as root):
sudo gem install bundler
- Git clone this repo and change to the root folder.
- Run bundle install:
bundle install
- Run jekyll serve:
bundle exec jekyll serve -w
- Assuming everything worked properly, open your browser to http://localhost:4000/