mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-11-16 06:05:00 -05:00
Improve previewing
Previewing is typically done to verify a change to content, a plugin, or a theme. In most of these cases, the person previewing will want to re-generate before previewing. This commit adds a call to the `generate` task from within the `preview` task to ensure that the newest content will be previewed. Additionally, since previewing is often done to verify changes to themes, it can be helpful to be able to see un-minified assets. This commit also sets a default value of 'development' to the `OCTOPRESS_ENV` environment value, which is used when making decisions as to how assets are compiled. This currently prevents the minification of the compiled scss. I also trimmed some trailing whitespace in the Rakefile.
This commit is contained in:
parent
fa105ce68d
commit
d483912e4b
2
Rakefile
2
Rakefile
@ -147,6 +147,8 @@ end
|
|||||||
desc "preview the site in a web browser."
|
desc "preview the site in a web browser."
|
||||||
task :preview do
|
task :preview do
|
||||||
raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." if configuration[:source].nil? || !File.directory?(configuration[:source])
|
raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." if configuration[:source].nil? || !File.directory?(configuration[:source])
|
||||||
|
ENV['OCTOPRESS_ENV'] ||= 'development'
|
||||||
|
Rake::Task["generate"].execute
|
||||||
guardPid = Process.spawn("guard")
|
guardPid = Process.spawn("guard")
|
||||||
puts "Starting Rack, serving to http://#{configuration[:server_host]}:#{configuration[:server_port]}"
|
puts "Starting Rack, serving to http://#{configuration[:server_host]}:#{configuration[:server_port]}"
|
||||||
rackupPid = Process.spawn("rackup --host #{configuration[:server_host]} --port #{configuration[:server_port]}")
|
rackupPid = Process.spawn("rackup --host #{configuration[:server_host]} --port #{configuration[:server_port]}")
|
||||||
|
Loading…
Reference in New Issue
Block a user