Jeffrey Paul: How To Blog

Jeffrey Paul

How To Blog 17 July 2015

This page documents the correct way to blog in 2015.

Overview

  • CloudFlare
  • git / GitHub

Prerequisites

  • Domain Name
  • Mac OS X Workstation
  • Apple Xcode
  • Homebrew Package Manager
  • Text Editor (vim or Atom)

Blog Setup

Use Jekyll to generate your site.

Use Git to manage your site’s history, and GitHub to visualize it.

  • Create a new directory and change into it.
  • Install a Makefile. Edit the S3 bucket URL below to the name of the bucket you’ve just created.
default: localserve

_site: vendor
    bundle exec jekyll build

vendor:
    bundle install --path vendor/bundle --binstubs vendor/bundle/bin

localserve: vendor
    bundle exec jekyll serve

clean:
    rm -rf tmp _site

distclean: clean
    rm -rfv vendor

deploy: _site
    git commit -a
    git push
  • Install a .gitignore file.
_site
.sass-cache
vendor
.bundle
  • Install a Gemfile.
source 'https://rubygems.org'
gem 'jekyll'
  • Install a _config.yml (edit to suit.)
# Site settings
title: My Blog Title
email: me@example.com
description: > # this means to ignore newlines until "baseurl:"
  My interesting blog site.
baseurl: "" # the subpath of your site, e.g. /blog/
url: "https://example.com" # the base hostname & protocol for your site
twitter_username: exampleuser
github_username: exampleuser
exclude: # these are important!
    - Makefile
    - .gitignore
    - Gemfile
    - Gemfile.lock
    - vendor
    - README.markdown
# Build settings
markdown: kramdown
sass:
  style: compressed
permalink: /:year:month:day/:title/
  • git init
  • git commit Makefile .gitignore Gemfile -m "initial"
  • bundle exec jekyll new .

Edit and Test

  • make will serve your site at http://127.0.0.1:4000/.
  • Edit any necessary layouts, posts, or other files.
  • Commit your changes when complete.
  • Upload your site to Github with make deploy.
  • Test at http://username.github.io.

TLS Key

Use StartSSL to get a TLS certificate for free.

Do not perform these steps in your blog directory.

  • Generate a key and Certificate Signing Request (CSR) using command line openssl. Generate a 2048 bit RSA key. (CloudFront won’t support 4096.)
openssl req -new -newkey rsa:2048 \
    -keyout example.com.key.pem \
    -out example.com.csr
  • Upload TLS Key and Certificate to CloudFlare

CloudFlare

  • Change your domain DNS settings to CloudFlare.
  • Add a CNAME record for the root of your domain, as well as www, with the value githubusername.github.io.

To Post

  • Clone repo
  • Make edits in _pages, _posts, et c.
  • Commit and push to GitHub.

About The Author

Jeffrey Paul is a hacker and security researcher living in Berlin and the founder of EEQJ, a consulting and research organization.

@sneakdotberlin

@eeqj

sneak@sneak.berlin

keybase.io/sneak

linkedin.com/in/jeffreypauleeqj