added blog_index_dir configuration and improved update_source
This commit is contained in:
parent
ef5b0e8ad7
commit
59521e3db8
12
Rakefile
12
Rakefile
@ -1,10 +1,6 @@
|
|||||||
require "rubygems"
|
require "rubygems"
|
||||||
require "bundler/setup"
|
require "bundler/setup"
|
||||||
|
|
||||||
# If you customize your site's index page setting custom_index to true
|
|
||||||
# will preserve your changes when running `rake update_source`
|
|
||||||
custom_index = false
|
|
||||||
|
|
||||||
## -- Rsync Deploy config -- ##
|
## -- Rsync Deploy config -- ##
|
||||||
# Be sure your public key is listed in your server's ~/.ssh/authorized_keys file
|
# Be sure your public key is listed in your server's ~/.ssh/authorized_keys file
|
||||||
ssh_user = "user@domain.com"
|
ssh_user = "user@domain.com"
|
||||||
@ -14,10 +10,11 @@ deploy_default = "rsync"
|
|||||||
# This will be configured for you when you run config_deploy
|
# This will be configured for you when you run config_deploy
|
||||||
deploy_branch = "gh-pages"
|
deploy_branch = "gh-pages"
|
||||||
|
|
||||||
## -- Misc Configs, you probably have no reason to changes these -- ##
|
## -- Misc Configs -- ##
|
||||||
|
|
||||||
public_dir = "public" # compiled site directory
|
public_dir = "public" # compiled site directory
|
||||||
source_dir = "source" # source file directory
|
source_dir = "source" # source file directory
|
||||||
|
blog_index_dir = 'source' # directory for your blog's index page (if you put your index in source/blog/index.html, set this to 'source/blog')
|
||||||
deploy_dir = "_deploy" # deploy directory (for Github pages deployment)
|
deploy_dir = "_deploy" # deploy directory (for Github pages deployment)
|
||||||
stash_dir = "_stash" # directory to stash posts for speedy generation
|
stash_dir = "_stash" # directory to stash posts for speedy generation
|
||||||
posts_dir = "_posts" # directory for blog files
|
posts_dir = "_posts" # directory for blog files
|
||||||
@ -126,7 +123,7 @@ end
|
|||||||
|
|
||||||
desc "Clean out caches: _code_cache, _gist_cache, .sass-cache"
|
desc "Clean out caches: _code_cache, _gist_cache, .sass-cache"
|
||||||
task :clean do
|
task :clean do
|
||||||
system "rm -rf _code_cache/** _gist_cache/** .sass-cache/**"
|
system "rm -rf _code_cache/** _gist_cache/** .sass-cache/** source/stylesheets/screen.css"
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Move sass to sass.old, install sass theme updates, replace sass/custom with sass.old/custom"
|
desc "Move sass to sass.old, install sass theme updates, replace sass/custom with sass.old/custom"
|
||||||
@ -155,7 +152,8 @@ task :update_source, :theme do |t, args|
|
|||||||
system "mkdir -p #{source_dir}; cp -R #{themes_dir}/"+theme+"/source/. #{source_dir}"
|
system "mkdir -p #{source_dir}; cp -R #{themes_dir}/"+theme+"/source/. #{source_dir}"
|
||||||
system "cp -Rn #{source_dir}.old/. #{source_dir}"
|
system "cp -Rn #{source_dir}.old/. #{source_dir}"
|
||||||
system "cp -Rf #{source_dir}.old/_includes/custom/. #{source_dir}/_includes/custom/"
|
system "cp -Rf #{source_dir}.old/_includes/custom/. #{source_dir}/_includes/custom/"
|
||||||
system "cp -Rf #{source_dir}.old/index.html #{source_dir}" if custom_index
|
system "mv -f #{source_dir}/index.html #{blog_index_dir}" if blog_index_dir != source_dir
|
||||||
|
system "cp -f #{source_dir}.old/index.html #{source_dir}" if blog_index_dir != source_dir
|
||||||
puts "## Updated #{source_dir} ##"
|
puts "## Updated #{source_dir} ##"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user