Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored multi-site support to not switch the public directory at r…
…untime. This was causing issues with pages served from the cache not having access to image resources.
- Loading branch information
Showing
10 changed files
with
49 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Add your own tasks in files placed in lib/tasks ending in .rake, | ||
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. | ||
|
||
require 'rake' | ||
|
||
namespace :site do | ||
|
||
desc "creates a new site" | ||
task :create, [:site_name] do |t, args| | ||
print "Site Name: " | ||
if site_name = args.site_name | ||
puts site_name | ||
else | ||
site_name = STDIN.readline.chomp | ||
end | ||
|
||
site_dir = "sites/#{site_name}" | ||
public_dir = "public/#{site_name}" | ||
|
||
raise "Site already exists" if File.exists?(site_dir) | ||
|
||
puts "Creating directories: #{site_dir}, #{public_dir}" | ||
FileUtils.mkdir_p([site_dir, public_dir]) | ||
|
||
puts "Copying site files." | ||
File.open("#{site_dir}/config.yml",'w') {|f| f.write( open('lib/site_skel/config.yml').read.gsub("%%_SITENAME_%%",site_name) ) } | ||
|
||
File.open("#{site_dir}/index.haml",'w') {|f| f.write( open('lib/site_skel/index.haml').read.gsub("%%_SITENAME_%%",site_name) ) } | ||
|
||
puts "Copying public files." | ||
FileUtils.cp('lib/site_skel/public/style.css',public_dir) | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
default_site: default | ||
cache_max_age: 300 | ||
cache_max_age: 300 | ||
# default_site: site_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# TweetScope Configuration | ||
|
||
title: %%_SITENAME_%% | ||
tagline: A New TweetScope Site | ||
query: "%%_SITENAME_%%" | ||
count: 20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters