Skip to content

Instantly share code, notes, and snippets.

@mdrmike
Last active October 24, 2016 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdrmike/78e1bd801ba8120f3dca8aee5a50d4f3 to your computer and use it in GitHub Desktop.
Save mdrmike/78e1bd801ba8120f3dca8aee5a50d4f3 to your computer and use it in GitHub Desktop.
#!/bin/sh
gem install jekyll bundler && echo ">>> Installed Jekyll and Bundler"
echo -e "source 'https://rubygems.org'\n\ngem 'github-pages', group: :jekyll_plugins" > Gemfile
bundle install && echo ">>> Installed Github pages dependencies"
bundle exec jekyll new . --force && echo ">>> Installed Jekyll"
sed -i 's|gem "jekyll"|# gem "jekyll"|g' Gemfile && echo ">>> Configured Gemfile: remove jekyll version lock"
sed -i 's|# gem "github-pages"|gem "github-pages"|g' Gemfile && echo ">>> Configured Gemfile: require github-pages gem"
sed -i 's|^ gem "jekyll-feed|# gem "jekyll-feed|g' Gemfile && echo ">>> Configured Gemfile: remove jekyll-feed gem"
echo -e "Gemfile.lock\n.c9\n_config_dev.yml\n" >> .gitignore
cat >> _config_dev.yml << EOF
host: "$IP"
port: "$PORT"
baseurl: ""
url: "https://$C9_HOSTNAME"
EOF
bundle install && echo ">>> Done."
echo -e "\nRun Jekyll: \n
bundle exec jekyll serve --config _config.yml,_config_dev.yml \n\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment