Skip to content

Commit

Permalink
Update build script and info.
Browse files Browse the repository at this point in the history
  • Loading branch information
trvrb committed Oct 11, 2015
1 parent 7278b6a commit 1e92533
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ jekyll build

To view the site, run `jekyll serve` and point a browser to `http://localhost:4000/`. More information on Jekyll can be found [here](http://jekyllrb.com/).

To include projects, preprocessing scripts are necessary to clone project repos and update Jekyll metadata. This can be accomplished with:

```
ruby _scripts/update-and-preprocess.rb
```

Then `jekyll build` works as normal.

## Contribute

Blog posts just require YAML top matter that looks something like:
Expand Down
1 change: 1 addition & 0 deletions _scripts/update-and-preprocess.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@

Dir.chdir($basedir)
`ruby _scripts/preprocess-markdown.rb`
`ruby _scripts/generate-project-data.rb`
4 changes: 2 additions & 2 deletions misc/_posts/2013-10-28-about.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The site is built with [Jekyll](http://jekyllrb.com/). This allows the site to

Content is stored as simple [Markdown](http://daringfireball.net/projects/markdown/) files with a bit of [YAML](http://yaml.org/) at the top. This keeps content mostly semantic and can be easily processed. An example post can be seen [here](https://github.com/blab/blotter/blob/master/blog/_posts/2012-02-20-github-of-science.md). In addition to including blog posts, simple Markdown files are included for papers and people, in which case the YAML metadata is bit broader, indicating things like paper PDFs or Twitter handles.

I had wanted to make it possible to point the site at GitHub repos and display their contents in a nicely formatted way. These are [projects](/projects/), and in their case, there is no data on them in the site, except for a [list of repo names](https://github.com/blab/blotter/blob/master/_config.yml). Project data is pulled in automatically by cloning the project repo and project metadata is gathered using [Octokit](http://octokit.github.io/octokit.rb/) to access the GitHub API via a [custom Jekyll plugin](https://github.com/blab/blotter/blob/master/_plugins/generate-projects.rb). This allows project pages to display things like a list of contributors and recent commits.
I had wanted to make it possible to point the site at GitHub repos and display their contents in a nicely formatted way. These are [projects](/projects/), and in their case, there is no data on them in the site, except for a [list of repo names](https://github.com/blab/blotter/blob/master/_config.yml). Project data is pulled in automatically by cloning the project repo and project metadata is gathered using [Octokit](http://octokit.github.io/octokit.rb/) to access the GitHub API via a [preprocessing script](https://github.com/blab/blotter/blob/master/_scripts/generate-project-data.rb). This allows project pages to display things like a list of contributors and recent commits.

### Design

Expand All @@ -45,4 +45,4 @@ Site layout and design is built on top of [Bootstrap](http://getbootstrap.com/).

### Deploy

Deployment is done automatically by pushing changes to GitHub. Whenever the [site repo](https://github.com/blab/blotter) is updated or if any project repo is updated, a webhook is fired from GitHub that causes a [Heroku](http://www.heroku.com/) instance running a custom web app named [blotter-hook](https://github.com/blab/blotter-hook) to automatically pull in latest code from GitHub, rebuild the site with Jekyll and deploy the site. Deployment is done to an [Amazon S3](http://aws.amazon.com/s3/) bucket, using [s3-website](https://github.com/laurilehmijoki/s3_website). I then have an [Amazon CloudFront](http://aws.amazon.com/cloudfront/) distribution set up to mirror the S3 files across Amazon's network to improve download speeds. This solution appears faster and cheaper than using other hosting providers and is ideal for serving a static site.
Deployment is done to an [Amazon S3](http://aws.amazon.com/s3/) bucket, using [s3-website](https://github.com/laurilehmijoki/s3_website). I've written a [script](https://github.com/blab/blotter-deploy) to update and deploy the site to S3. I then have an [Amazon CloudFront](http://aws.amazon.com/cloudfront/) distribution set up to mirror the S3 files across Amazon's network to improve download speeds. This solution appears faster and cheaper than using other hosting providers and is ideal for serving a static site.

0 comments on commit 1e92533

Please sign in to comment.