Skip to content

Instantly share code, notes, and snippets.

@avinasha
Created August 29, 2012 01:47
Show Gist options
  • Save avinasha/3505980 to your computer and use it in GitHub Desktop.
Save avinasha/3505980 to your computer and use it in GitHub Desktop.
Deploying Jekyll Bootstrap using Capistrano
host:
development:
production: https://supportbee.com/devblog
JB :
version : 0.2.13
setup:
provider: custom
before 'deploy:update', 'deploy:update_jekyll'
namespace :deploy do
desc 'Run jekyll to update site before uploading'
task :update_jekyll do
%x(rm -rf _site/* )
require 'jekyll'
opt = Jekyll.configuration({})
source = opt['source']
destination = opt['destination']
site = Jekyll::Site.new(opt.merge({'auto' => 'false', 'env' => 'production'}))
puts "Building site: #{source} -> #{destination}"
begin
site.process
rescue Jekyll::FatalException => e
puts
puts "ERROR: YOUR SITE COULD NOT BE BUILT:"
puts "------------------------------------"
puts e.message
exit(1)
end
puts "Successfully generated site: #{source} -> #{destination}"
end
end
# /_includes/JB/analytics
{% if site.env == 'production' and site.JB.analytics.provider and page.JB.analytics != false %}
# /_includes/JB/comments-providers/disqus
{% if site.env == 'development' %}var disqus_developer = 1;{% endif %}
# /_includes/JB/sharing
{% if site.env == 'production' and site.JB.sharing.provider and page.JB.sharing != false %}
# /_includes/custom/setup
{% assign BASE_PATH = site.host[site.env] %}
{% assign HOME_PATH = site.host[site.env] %}
{% if site.JB.ASSET_PATH %}
{% assign ASSET_PATH = site.JB.ASSET_PATH %}
{% else %}
{% capture ASSET_PATH %}{{ BASE_PATH }}/assets/themes/{{ page.theme.name }}{% endcapture %}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment