Browse code

now using rack instead of Jekyll's webrick server, fixes #90

Brandon Mathis authored on 11/08/2011 at 23:56:25
Showing 2 changed files
... ...
@@ -20,6 +20,7 @@ posts_dir    = "_posts"    # directory for blog files
20 20
 themes_dir   = ".themes"   # directory for blog files
21 21
 new_post_ext = "markdown"  # default new post file extension when using the new_post task
22 22
 new_page_ext = "markdown"  # default new page file extension when using the new_page task
23
+server_port  = "4000"      # port for preview server eg. localhost:4000
23 24
 
24 25
 
25 26
 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]"
... ...
@@ -52,7 +53,7 @@ end
52 52
 
53 53
 desc "preview the site in a web browser"
54 54
 task :preview do
55
-  system "trap 'kill $jekyllPid $compassPid' Exit; jekyll --auto --server & jekyllPid=$!; compass watch & compassPid=$!; wait"
55
+  system "trap 'kill $jekyllPid $compassPid $rackPid' Exit; jekyll --auto & jekyllPid=$!; compass watch & compassPid=$!; rackup --port #{server_port} & rackPid=$!; wait"
56 56
 end
57 57
 
58 58
 # usage rake new_post[my-new-post] or rake new_post['my new post'] or rake new_post (defaults to "new-post")
... ...
@@ -20,7 +20,6 @@ email:
20 20
 
21 21
 # If publishing to a subdirectory as in http://site.com/project set 'root: /project'
22 22
 root: /
23
-server_port: 4000
24 23
 permalink: /blog/:year/:month/:day/:title/
25 24
 source: source
26 25
 destination: public