mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
fix docs site navigation
needed to prefix links with version strings
This commit is contained in:
parent
28f26e6268
commit
dd50639fc2
1 changed files with 11 additions and 1 deletions
12
Rakefile
12
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
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue