Browse code

added blog_index_dir configuration and improved update_source

Brandon Mathis authored on 16/08/2011 at 05:49:49
Showing 1 changed files
... ...
@@ -1,10 +1,6 @@
1 1
 require "rubygems"
2 2
 require "bundler/setup"
3 3
 
4
-# If you customize your site's index page setting custom_index to true
5
-# will preserve your changes when running `rake update_source`
6
-custom_index = false
7
-
8 4
 ## -- Rsync Deploy config -- ##
9 5
 # Be sure your public key is listed in your server's ~/.ssh/authorized_keys file
10 6
 ssh_user       = "user@domain.com"
... ...
@@ -14,17 +10,18 @@ deploy_default = "rsync"
14 14
 # This will be configured for you when you run config_deploy
15 15
 deploy_branch  = "gh-pages"
16 16
 
17
-## -- Misc Configs, you probably have no reason to changes these -- ##
17
+## -- Misc Configs -- ##
18 18
 
19
-public_dir   = "public"    # compiled site directory
20
-source_dir   = "source"    # source file directory
21
-deploy_dir   = "_deploy"   # deploy directory (for Github pages deployment)
22
-stash_dir    = "_stash"    # directory to stash posts for speedy generation
23
-posts_dir    = "_posts"    # directory for blog files
24
-themes_dir   = ".themes"   # directory for blog files
25
-new_post_ext = "markdown"  # default new post file extension when using the new_post task
26
-new_page_ext = "markdown"  # default new page file extension when using the new_page task
27
-server_port  = "4000"      # port for preview server eg. localhost:4000
19
+public_dir      = "public"    # compiled site directory
20
+source_dir      = "source"    # source file directory
21
+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')
22
+deploy_dir      = "_deploy"   # deploy directory (for Github pages deployment)
23
+stash_dir       = "_stash"    # directory to stash posts for speedy generation
24
+posts_dir       = "_posts"    # directory for blog files
25
+themes_dir      = ".themes"   # directory for blog files
26
+new_post_ext    = "markdown"  # default new post file extension when using the new_post task
27
+new_page_ext    = "markdown"  # default new page file extension when using the new_page task
28
+server_port     = "4000"      # port for preview server eg. localhost:4000
28 29
 
29 30
 
30 31
 desc "Initial setup for Octopress: copies the default theme into the path of Jekyll's generator. Rake install defaults to rake install[classic] to install a different theme run rake install[some_theme_name]"
... ...
@@ -126,7 +123,7 @@ end
126 126
 
127 127
 desc "Clean out caches: _code_cache, _gist_cache, .sass-cache"
128 128
 task :clean do
129
-  system "rm -rf _code_cache/** _gist_cache/** .sass-cache/**"
129
+  system "rm -rf _code_cache/** _gist_cache/** .sass-cache/** source/stylesheets/screen.css"
130 130
 end
131 131
 
132 132
 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|
155 155
   system "mkdir -p #{source_dir}; cp -R #{themes_dir}/"+theme+"/source/. #{source_dir}"
156 156
   system "cp -Rn #{source_dir}.old/. #{source_dir}"
157 157
   system "cp -Rf #{source_dir}.old/_includes/custom/. #{source_dir}/_includes/custom/"
158
-  system "cp -Rf #{source_dir}.old/index.html #{source_dir}" if custom_index
158
+  system "mv -f #{source_dir}/index.html #{blog_index_dir}" if blog_index_dir != source_dir
159
+  system "cp -f #{source_dir}.old/index.html #{source_dir}" if blog_index_dir != source_dir
159 160
   puts "## Updated #{source_dir} ##"
160 161
 end
161 162