Created
August 29, 2012 01:47
-
-
Save avinasha/3505980 to your computer and use it in GitHub Desktop.
Deploying Jekyll Bootstrap using Capistrano
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
host: | |
development: | |
production: https://supportbee.com/devblog | |
JB : | |
version : 0.2.13 | |
setup: | |
provider: custom |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /_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 %} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /_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