Skip to content

Commit

Permalink
Adding rake unpublish to help translators get started and updating th…
Browse files Browse the repository at this point in the history
…e readme accordingly
  • Loading branch information
qrush committed Aug 1, 2009
1 parent d591ced commit cdfbc4e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
20 changes: 16 additions & 4 deletions README.md
Expand Up @@ -25,16 +25,28 @@ If you want to submit tips, [please do so here](http://gitready.com/submit.html)
If you are interested in translating posts into another language, great! Here's what to do:

* Fork the project.
* Create a branch with the ISO code for your language
* Create a branch with the ISO code for your language, so for english:

<pre>
git checkout -b en
</pre>

* Unpublish all the posts (and commit your changes):

<pre>
rake unpublish
git commit -am "Unpublishing all the posts"
</pre>

* Translate the front page headers, footers. Check out the other translated sites for an example, such as the [german one](http://de.gitready.com).
* Translate as little or as many posts as you so desire.
* The posts that aren't translated, add this to the YAML front matter (this way, untranslated posts don't show up):
* Push your work back up (remember to the right branch name!):

<pre>
published: false
git push origin en
</pre>

* Submit a pull request to the main repository.
* Submit a pull request to qrush's repository.

Once that's done, I'll add your language's subdomain and get it published.

Expand Down
10 changes: 10 additions & 0 deletions Rakefile
Expand Up @@ -28,3 +28,13 @@ EOF
ssh.exec commands
end
end

desc "Unpublish all posts"
task :unpublish do
Dir["_posts/*.textile"].each do |post|
puts "Unpublishing #{post}"
lines = File.readlines(post)
lines.insert(1, "published: false\n")
File.open(post, "w") { |f| f.write lines.join }
end
end

0 comments on commit cdfbc4e

Please sign in to comment.