Skip to content

Instantly share code, notes, and snippets.

@ScriptAutomate
Last active August 29, 2018 22:28
Show Gist options
  • Save ScriptAutomate/e5b6099e01583ab8974a07a0143873b2 to your computer and use it in GitHub Desktop.
Save ScriptAutomate/e5b6099e01583ab8974a07a0143873b2 to your computer and use it in GitHub Desktop.
Basic code for setting up Jekyll locally
# Initial VM updates
sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y && sudo apt autoclean
# Vars for download/install endpoints
VSCODE='vscode.deb'
CHEFDK='chefdk.deb'
VSCODEURL='https://go.microsoft.com/fwlink/?LinkID=760868'
CHEFDKURL='https://packages.chef.io/files/stable/chefdk/3.1.0/ubuntu/18.04/chefdk_3.1.0-1_amd64.deb'
# Dev tool downloads
cd ~/Downloads
wget -O "$VSCODE" "$VSCODEURL"
wget -O "$CHEFDK" "$CHEFDKURL"
# Dev tool installs
sudo dpkg -i "$VSCODE"
sudo dpkg -i "$CHEFDK"
sudo apt install git -y
# Install Jekyll via ChefDK Segregated Gems
chef gem install jekyll
chef gem install bundler
# Add to ~/.bashrc to access Jekyll via command line
echo '# ChefDK custom gems
PATH="/home/$USER/.chefdk/gem/ruby/2.5.0/bin:$PATH"' >> ~/.bashrc
# Add Chef added gems to current active path
PATH="/home/$USER/.chefdk/gem/ruby/2.5.0/bin:$PATH"
# Jekyll commands
mkdir ~/projects
cd ~/projects
jekyll new mynewsite
cd mynewsite
bundle install --path vendor/bundle
bundle exec jekyll serve # Basic Jekyll site, with minimal template
# Minimal Mistakes theme?
cd ~/projects
git clone https://github.com/mmistakes/minimal-mistakes.git
cd minimimal-mistakes/docs
bundle install --path vendor/bundle
bundle exec jekyll serve # Can see what the preview site looks like
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment