Repo for chriserickson.me
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
content
pelican-plugins @ 2c7e30a
theme
.editorconfig
.gitignore
.gitmodules
LICENSE
Makefile
README.md
deploy_purge_cf_zone.sh
deploy_to_s3.py
package.json
pelicanconf.py
publishconf_prod.py
publishconf_stage.py
requirements.txt
yarn.lock

README.md

chriserickson.me

Introduction

This is the source for https://chriserickson.me. It is built on the Pelican static blogging engine.

Developing

All development can be done locally, without the use of a virtual machine (Vagrant, VirtualBox, VMWare, etc). For a manual, but simple workflow, you can run any number of fabric commands:

$ fab rebuild  # Purge old files, rebuild
$ fab build    # Build any changed files
$ fab serve    # Fire up a basic webserver at http://localhost:5000

After running fab serve, you will have a webserver running, that you will need to stop manually using Ctrl-C. This needs to be stopped, and fab build run anytime you make changes.

For something a bit more useful, you can use the develop_server.sh script. It has a few options as well:

$ ./develop_server.sh
# > usage: ./develop_server.sh (stop) (start) (restart) [port]

Typically you would run this with ./develop_server.sh start 5000. This watches files for any changes, and should pick them up automatically. This kicks off the server in the background, so when you're all done, you'll want to stop the server by running ./develop_server.sh stop.

Getting Latest Submodules

# First time
git submodule init
git submodule update
# Source: http://stackoverflow.com/a/5828396/2057885
git submodule foreach git pull origin master
# or sometimes this works
git submodule update --init --recursive
# This is new and updates the commit number
git submodule update --remote --merge

Writing Content

Contributing Content

Content can be contributed through a typical pull request cycle. Write something compelling in a branch, create a pull request, then merge it. Content should be written in Markdown.

Directory Structure

  • Posts: content
  • Pages: content/pages
  • Images: content/images

File Names

Document names are not important to the function of the site, but should be formulated in a helpful manner such as YYYY-MM-DD_The-title-of-the-post.md to allow for better sorting.

Types of Content

Posts

Posts are used for what is usually considered 'blog' content. They are typically displayed in a list, sorted by date. They are kept in the content directory. Meta data in the post document itself will be used to generate the site.

Here is an example post:

title: This new thing will knock your socks off
subtitle: What happened to your shoes?
date: 2014-01-30 3:50

Your interesting story starts now.

Linked Posts

This is a slight variant to a standard post. Linked posts are used to feature and add to the conversation that was started elsewhere. Examples of this might be to quote someone whom says important things, or provide direct commentary on the blog post of someone else. These differ in format only by featuring a link in the metadata.

Here is an example linked post:

title: This new thing will knock your socks off
subtitle: What happened to your shoes?
date: 2014-01-30 3:50
link: https://www.apple.com

> Your mind is blown with this thing I said.

I think this person is wrong.

Pages

Pages are generally used for content that falls outside the chronological flow of a typical post. Examples might include an About page, a page listing various contact methods or other special content. These are kept in the content/pages directory.

Here is an example page:

title: About
date: 2014-01-30 3:50
modified: 2014-01-30 3:50

Your content starts here.

Linking to Static Media

If you want to include images in a post, you need to use the following syntax (make sure to place the images in the right directory, as indicated above):

![The watch!]({filename}/images/watch.jpg)

Deploying Content

cd "/var/www/venvs/chriserickson.me/chriserickson.me"
source "/var/www/venvs/chriserickson.me/bin/activate"
git pull
git submodule foreach git pull origin master
pip install -r requirements.txt
yarn install
./node_modules/.bin/bower install
make publish

If a CDN is in place, updates might take a while to propagate.

Build Instructions

You will need to have Python 2, virtualenv and Node.js installed in your system.

# Create a virtualenv
mkvirtualenv chriserickson.me
# Activate virtualenv
source chriserickson.me/bin/activate
# Clone the git repo
git clone git@github.com:chris-erickson/chriserickson.me.git chriserickson.me
cd chriserickson.me
# Install Python Requirements
pip install -r requirements.txt
# Install Bower static files
bower install # May need ./node_modules/.bin/bower install if node_modules isn't in PATH
# Development build
pelican -s pelicanconf.py
# or Production build
pelican -s publishconf.py

Preparing the Server

Configure a user:

sudo useradd -d /home/pelican-blog -m pelican-blog
sudo passwd pelican-blog

Configure a virtual environment:

cd /var/www/venvs/
virtualenv ./chriserickson.me
sudo chown -R pelican-blog:pelican-blog chriserickson.me
source chriserickson.me/bin/activate

Create an ssh key (for GitHub):

sudo su - pelican-blog
ssh-keygen -t rsa -C "id_rsa"

Fetch the site files from GitHub:

cd /var/www/venvs/chriserickson.me/
git clone https://github.com/chris-erickson/chriserickson.me
git pull && git submodule init && git submodule update && git submodule status

Install python dependencies:

pip install -r requirements.txt

Install node dependencies:

yarn install

Install Bower dependencies:

# Depends on yarn install
bower install