Use Launchy for cross platform site:preview. Thx @ixti.
This commit is contained in:
parent
88bdb15338
commit
95b07a3c2b
4
Rakefile
4
Rakefile
|
@ -118,12 +118,14 @@ end
|
||||||
namespace :site do
|
namespace :site do
|
||||||
desc "Generate and view the site locally"
|
desc "Generate and view the site locally"
|
||||||
task :preview do
|
task :preview do
|
||||||
|
require "launchy"
|
||||||
|
|
||||||
# Yep, it's a hack! Wait a few seconds for the Jekyll site to generate and
|
# Yep, it's a hack! Wait a few seconds for the Jekyll site to generate and
|
||||||
# then open it in a browser. Someday we can do better than this, I hope.
|
# then open it in a browser. Someday we can do better than this, I hope.
|
||||||
Thread.new do
|
Thread.new do
|
||||||
sleep 4
|
sleep 4
|
||||||
puts "Opening in browser..."
|
puts "Opening in browser..."
|
||||||
sh "open http://localhost:4000"
|
Launchy.open("http://localhost:4000")
|
||||||
end
|
end
|
||||||
|
|
||||||
# Generate the site in server mode.
|
# Generate the site in server mode.
|
||||||
|
|
|
@ -39,6 +39,7 @@ Gem::Specification.new do |s|
|
||||||
s.add_development_dependency('RedCloth', "~> 4.2")
|
s.add_development_dependency('RedCloth', "~> 4.2")
|
||||||
s.add_development_dependency('rdiscount', "~> 1.6")
|
s.add_development_dependency('rdiscount', "~> 1.6")
|
||||||
s.add_development_dependency('redcarpet', "~> 2.1.1")
|
s.add_development_dependency('redcarpet', "~> 2.1.1")
|
||||||
|
s.add_development_dependency('launchy', "~> 2.1.2")
|
||||||
|
|
||||||
# = MANIFEST =
|
# = MANIFEST =
|
||||||
s.files = %w[
|
s.files = %w[
|
||||||
|
|
Loading…
Reference in New Issue