mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2025-02-28 16:31:44 -05:00
Merge branch 'master' into site
This commit is contained in:
commit
fd1c54bae6
3
.slugignore
Normal file
3
.slugignore
Normal file
@ -0,0 +1,3 @@
|
||||
plugins
|
||||
sass
|
||||
source
|
@ -92,7 +92,7 @@ function flashVideoFallback(){
|
||||
function wrapFlashVideos() {
|
||||
$('object').each(function(object) {
|
||||
object = $(object);
|
||||
if (object.children('param[name=movie]')) {
|
||||
if ( $('param[name=movie]', object).length ) {
|
||||
var wrapper = object.before('<div class="flash-video"><div>').previous();
|
||||
$(wrapper).children().append(object);
|
||||
}
|
||||
|
50
Rakefile
50
Rakefile
@ -227,6 +227,7 @@ multitask :push do
|
||||
(Dir["#{deploy_dir}/*"]).each { |f| rm_rf(f) }
|
||||
Rake::Task[:copydot].invoke(public_dir, deploy_dir)
|
||||
puts "\n## copying #{public_dir} to #{deploy_dir}"
|
||||
system "cp -R #{public_dir}/* #{deploy_dir}"
|
||||
cd "#{deploy_dir}" do
|
||||
system "git add ."
|
||||
system "git add -u"
|
||||
@ -234,7 +235,7 @@ multitask :push do
|
||||
message = "Site updated at #{Time.now.utc}"
|
||||
system "git commit -m \"#{message}\""
|
||||
puts "\n## Pushing generated #{deploy_dir} website"
|
||||
system "git push origin #{deploy_branch}"
|
||||
system "git push origin #{deploy_branch} --force"
|
||||
puts "\n## Github Pages deploy complete"
|
||||
end
|
||||
end
|
||||
@ -274,25 +275,54 @@ task :set_root_dir, :dir do |t, args|
|
||||
end
|
||||
end
|
||||
|
||||
desc "Setup _deploy folder and deploy branch"
|
||||
task :config_deploy, :branch do |t, args|
|
||||
puts "!! Please provide a deploy branch, eg. rake init_deploy[gh-pages] !!" unless args.branch
|
||||
puts "## Creating a clean #{args.branch} branch in ./#{deploy_dir} for Github pages deployment"
|
||||
desc "Set up _deploy folder and deploy branch for Github Pages deployment"
|
||||
task :setup_github_pages do
|
||||
repo_url = get_stdin("Enter the read/write url for your repository: ")
|
||||
user = repo_url.match(/:([^\/]+)/)[1]
|
||||
branch = (repo_url.match(/\/\w+.github.com/).nil?) ? 'gh-pages' : 'master'
|
||||
project = (branch == 'gh-pages') ? repo_url.match(/\/([^\.]+)/)[1] : ''
|
||||
unless `git remote -v`.match(/origin.+?octopress.git/).nil?
|
||||
# If octopress is still the origin remote (from cloning) rename it to octopress
|
||||
system "git remote rename origin octopress"
|
||||
if branch == 'master'
|
||||
# If this is a user/organization pages repository, add the correct origin remote
|
||||
# and checkout the source branch for committing changes to the blog source.
|
||||
system "git remote add origin #{repo_url}"
|
||||
puts "Added remote #{repo_url} as origin"
|
||||
system "git config branch.master.remote origin"
|
||||
puts "Set origin as default remote"
|
||||
system "git branch -m master source"
|
||||
puts "Master branch renamed to 'source' for committing your blog source files"
|
||||
else
|
||||
unless !public_dir.match("#{project}").nil?
|
||||
system "rake set_root_dir[#{project}]"
|
||||
end
|
||||
end
|
||||
end
|
||||
url = "http://#{user}.github.com"
|
||||
url += "/#{project}" unless project == ''
|
||||
jekyll_config = IO.read('_config.yml')
|
||||
jekyll_config.sub!(/^url:.*$/, "url: #{url}")
|
||||
File.open('_config.yml', 'w') do |f|
|
||||
f.write jekyll_config
|
||||
end
|
||||
rm_rf deploy_dir
|
||||
mkdir deploy_dir
|
||||
cd "#{deploy_dir}" do
|
||||
system "git symbolic-ref HEAD refs/heads/#{args.branch}"
|
||||
system "rm .git/index"
|
||||
system "git clean -fdx"
|
||||
system "git init"
|
||||
system "echo 'My Octopress Page is coming soon …' > index.html"
|
||||
system "git add ."
|
||||
system "git commit -m \"Octopress init\""
|
||||
system "git branch -m gh-pages" unless branch == 'master'
|
||||
system "git remote add origin #{repo_url}"
|
||||
rakefile = IO.read(__FILE__)
|
||||
rakefile.sub!(/deploy_branch(\s*)=(\s*)(["'])[\w-]*["']/, "deploy_branch\\1=\\2\\3#{args.branch}\\3")
|
||||
rakefile.sub!(/deploy_branch(\s*)=(\s*)(["'])[\w-]*["']/, "deploy_branch\\1=\\2\\3#{branch}\\3")
|
||||
rakefile.sub!(/deploy_default(\s*)=(\s*)(["'])[\w-]*["']/, "deploy_default\\1=\\2\\3push\\3")
|
||||
File.open(__FILE__, 'w') do |f|
|
||||
f.write rakefile
|
||||
end
|
||||
end
|
||||
puts "## Deployment configured. Now you can deploy to the #{args.branch} branch with `rake deploy` ##"
|
||||
puts "\n---\n## Now you can deploy to #{url} with `rake deploy` ##"
|
||||
end
|
||||
|
||||
def ok_failed(condition)
|
||||
|
Loading…
x
Reference in New Issue
Block a user