From dd50639fc2eea362dc06ea833ff72fe2960896dc Mon Sep 17 00:00:00 2001 From: geemus Date: Sun, 3 Apr 2011 06:43:32 -0400 Subject: [PATCH] fix docs site navigation needed to prefix links with version strings --- Rakefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 436966c99..d8c203344 100644 --- a/Rakefile +++ b/Rakefile @@ -146,8 +146,18 @@ task :docs do key = '' << version << '/' << file_name Formatador.redisplay(' ' * 80) # clear last line Formatador.redisplay('Uploading ' << key) + if File.extname(file_name) == '.html' + # rewrite links with version + body = File.read(file_path) + body.gsub!(/href="\//, 'href="/' << version << '/') + content_type = 'text/html' + else + body = File.open(file_path) + content_type = nil # leave it up to mime-types + end directory.files.create( - :body => File.open(file_path), + :body => body, + :content_type => content_type, :key => key, :public => true )