mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-11-01 07:45:01 -04:00
improved new_post title substitutions, fixed directories in rake update tasks
This commit is contained in:
parent
14a0f8f9c6
commit
9fa5ce9ebe
6
Rakefile
6
Rakefile
@ -62,7 +62,7 @@ task :new_post, :title do |t, args|
|
|||||||
mkdir_p "#{source_dir}/#{posts_dir}"
|
mkdir_p "#{source_dir}/#{posts_dir}"
|
||||||
args.with_defaults(:title => 'new-post')
|
args.with_defaults(:title => 'new-post')
|
||||||
title = args.title
|
title = args.title
|
||||||
filename = "#{source_dir}/#{posts_dir}/#{Time.now.strftime('%Y-%m-%d')}-#{title.downcase.gsub(/&/,'and').gsub(/[,\.'":\(\)\[\]]/,'').gsub(/\W/, '-')}.#{new_post_ext}"
|
filename = "#{source_dir}/#{posts_dir}/#{Time.now.strftime('%Y-%m-%d')}-#{title.downcase.gsub(/&/,'and').gsub(/[,'":\?!\(\)\[\]]/,'').gsub(/[\W\.]/, '-').gsub(/-+$/,'')}.#{new_post_ext}"
|
||||||
puts "Creating new post: #{filename}"
|
puts "Creating new post: #{filename}"
|
||||||
open(filename, 'w') do |post|
|
open(filename, 'w') do |post|
|
||||||
system "mkdir -p #{source_dir}/#{posts_dir}/";
|
system "mkdir -p #{source_dir}/#{posts_dir}/";
|
||||||
@ -130,7 +130,7 @@ task :update_style, :theme do |t, args|
|
|||||||
theme = args.theme || 'classic'
|
theme = args.theme || 'classic'
|
||||||
system "mv sass sass.old"
|
system "mv sass sass.old"
|
||||||
puts "## Moved styles into sass.old/"
|
puts "## Moved styles into sass.old/"
|
||||||
system "mkdir -p sass; cp -R #{themes_dir}/"+theme+"/sass/ sass/"
|
system "mkdir -p sass; cp -R #{themes_dir}/"+theme+"/sass/* sass/"
|
||||||
cp_r "sass.old/custom/.", "sass/custom"
|
cp_r "sass.old/custom/.", "sass/custom"
|
||||||
puts "## Updated Sass ##"
|
puts "## Updated Sass ##"
|
||||||
end
|
end
|
||||||
@ -140,7 +140,7 @@ task :update_source, :theme do |t, args|
|
|||||||
theme = args.theme || 'classic'
|
theme = args.theme || 'classic'
|
||||||
system "mv #{source_dir} #{source_dir}.old"
|
system "mv #{source_dir} #{source_dir}.old"
|
||||||
puts "moved #{source_dir} into #{source_dir}.old/"
|
puts "moved #{source_dir} into #{source_dir}.old/"
|
||||||
system "mkdir -p #{source_dir}; cp -R #{themes_dir}/"+theme+"/source/. #{source_dir}"
|
system "mkdir -p #{source_dir}; cp -R #{themes_dir}/"+theme+"/source/*. #{source_dir}"
|
||||||
system "cp -Rn #{source_dir}.old/. #{source_dir}"
|
system "cp -Rn #{source_dir}.old/. #{source_dir}"
|
||||||
system "cp -f #{source_dir}.old/_includes/navigation.html #{source_dir}/_includes/navigation.html"
|
system "cp -f #{source_dir}.old/_includes/navigation.html #{source_dir}/_includes/navigation.html"
|
||||||
puts "## Updated #{source_dir} ##"
|
puts "## Updated #{source_dir} ##"
|
||||||
|
@ -27,12 +27,9 @@ repository is named `your_username.github.com` or `your_organization.github.com`
|
|||||||
Next, setup an [RVM](http://beginrescueend.com/) and install dependencies.
|
Next, setup an [RVM](http://beginrescueend.com/) and install dependencies.
|
||||||
|
|
||||||
rvm rvmrc trust
|
rvm rvmrc trust
|
||||||
|
rvm reload
|
||||||
bundle install
|
bundle install
|
||||||
|
|
||||||
# Install pygments (for syntax highlighing)
|
|
||||||
sudo easy_install pip
|
|
||||||
sudo pip install pygments
|
|
||||||
|
|
||||||
Install the default Octopress theme,
|
Install the default Octopress theme,
|
||||||
|
|
||||||
rake install
|
rake install
|
||||||
|
Loading…
Reference in New Issue
Block a user