From ebb4ee22145414317b97789252c571e2c694f571 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 29 Jun 2014 22:44:51 +0000 Subject: [PATCH] Adding Jekyll container which includes very basic starter content --- jekyll-github-pages/.gitignore | 1 + jekyll-github-pages/Dockerfile | 22 +++++++++++++++++++ jekyll-github-pages/Gemfile | 2 ++ jekyll-github-pages/README.md | 14 ++++++++++++ jekyll-github-pages/start.sh | 13 +++++++++++ jekyll-github-pages/template/_config.yml | 0 .../template/_includes/footer.html | 3 +++ .../template/_includes/header.html | 3 +++ .../template/_includes/top.html | 18 +++++++++++++++ .../template/_layouts/default.html | 12 ++++++++++ jekyll-github-pages/template/index.html | 6 +++++ 11 files changed, 94 insertions(+) create mode 100644 jekyll-github-pages/.gitignore create mode 100644 jekyll-github-pages/Dockerfile create mode 100644 jekyll-github-pages/Gemfile create mode 100644 jekyll-github-pages/README.md create mode 100755 jekyll-github-pages/start.sh create mode 100644 jekyll-github-pages/template/_config.yml create mode 100644 jekyll-github-pages/template/_includes/footer.html create mode 100644 jekyll-github-pages/template/_includes/header.html create mode 100644 jekyll-github-pages/template/_includes/top.html create mode 100644 jekyll-github-pages/template/_layouts/default.html create mode 100644 jekyll-github-pages/template/index.html diff --git a/jekyll-github-pages/.gitignore b/jekyll-github-pages/.gitignore new file mode 100644 index 00000000..c9490a53 --- /dev/null +++ b/jekyll-github-pages/.gitignore @@ -0,0 +1 @@ +/site diff --git a/jekyll-github-pages/Dockerfile b/jekyll-github-pages/Dockerfile new file mode 100644 index 00000000..b061600d --- /dev/null +++ b/jekyll-github-pages/Dockerfile @@ -0,0 +1,22 @@ +FROM ubuntu:trusty + +MAINTAINER itzg + +RUN apt-get update +RUN apt-get -y upgrade + +RUN apt-get -y install ruby ruby-dev make patch +RUN gem install bundler + +ADD Gemfile /tmp/Gemfile +WORKDIR /tmp +RUN bundle install + +ADD template /site-template + +VOLUME ["/site"] +EXPOSE 4000 + +ADD start.sh /start +CMD ["/start"] + diff --git a/jekyll-github-pages/Gemfile b/jekyll-github-pages/Gemfile new file mode 100644 index 00000000..053c27dc --- /dev/null +++ b/jekyll-github-pages/Gemfile @@ -0,0 +1,2 @@ +source 'https://rubygems.org' +gem 'github-pages' diff --git a/jekyll-github-pages/README.md b/jekyll-github-pages/README.md new file mode 100644 index 00000000..cd8b4736 --- /dev/null +++ b/jekyll-github-pages/README.md @@ -0,0 +1,14 @@ +This container is pre-configured according to the +[GitHub Pages use of Jekyll](https://help.github.com/articles/using-jekyll-with-pages). + +It serves up the generated content on port 4000 and the site is generated from +the container's `/site` volume. You can either bring your own site content or +let it generate some VERY simple content along with the standard Jekyll directory +layout. + +A typical way to run this: + + docker run -it -p 4000:4000 -v $(pwd)/site:/site itzg/jekyll-github-pages + +where either it will load your content or initialize the content under +`site` in your current working directory. diff --git a/jekyll-github-pages/start.sh b/jekyll-github-pages/start.sh new file mode 100755 index 00000000..91e22011 --- /dev/null +++ b/jekyll-github-pages/start.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +if [ `ls /site/index.* 2> /dev/null | wc -l` = 0 ]; then + echo "Preparing /site with default content..." + cp -r /site-template/* /site +fi + +if [ ! -e /site/Gemfile ]; then + cp /tmp/Gemfile /site/Gemfile +fi + +cd /site +bundle exec jekyll serve diff --git a/jekyll-github-pages/template/_config.yml b/jekyll-github-pages/template/_config.yml new file mode 100644 index 00000000..e69de29b diff --git a/jekyll-github-pages/template/_includes/footer.html b/jekyll-github-pages/template/_includes/footer.html new file mode 100644 index 00000000..a671ded0 --- /dev/null +++ b/jekyll-github-pages/template/_includes/footer.html @@ -0,0 +1,3 @@ + diff --git a/jekyll-github-pages/template/_includes/header.html b/jekyll-github-pages/template/_includes/header.html new file mode 100644 index 00000000..023b7e80 --- /dev/null +++ b/jekyll-github-pages/template/_includes/header.html @@ -0,0 +1,3 @@ +
+

{{ page.title }}

+
diff --git a/jekyll-github-pages/template/_includes/top.html b/jekyll-github-pages/template/_includes/top.html new file mode 100644 index 00000000..58e30d2c --- /dev/null +++ b/jekyll-github-pages/template/_includes/top.html @@ -0,0 +1,18 @@ + + + + + + + + {{ page.title }} + + + + + + + + + + diff --git a/jekyll-github-pages/template/_layouts/default.html b/jekyll-github-pages/template/_layouts/default.html new file mode 100644 index 00000000..a25c7190 --- /dev/null +++ b/jekyll-github-pages/template/_layouts/default.html @@ -0,0 +1,12 @@ +{% include top.html %} + + + + {% include header.html %} + + {{ content }} + + {% include footer.html %} + + + diff --git a/jekyll-github-pages/template/index.html b/jekyll-github-pages/template/index.html new file mode 100644 index 00000000..99058d93 --- /dev/null +++ b/jekyll-github-pages/template/index.html @@ -0,0 +1,6 @@ +--- +layout: default +title: Powered by Jekyll +overview: true +--- +This is where the content goes.