Skip to content

Commit 4fbcf55

Browse files
committed
fix: Generate correct navigation.html for Rails 7.1
1 parent ab9fe70 commit 4fbcf55

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Rakefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,19 @@ def generate_src(target_version:)
8383
cp_r copy_sources, target_dir
8484

8585
cd target_dir do
86+
# Generate index.html
8687
if Gem::Version.new(target_version) >= Gem::Version.new('7.1')
8788
cp NEW_INDEX_HTML, 'index.html'
88-
return
89+
else
90+
cp INDEX_HTML, 'index.html'
8991
end
9092

91-
cp INDEX_HTML, 'index.html'
9293
# Prepend version number to the absolute path in navigation.html
93-
content = File.read('navigation.html')
94-
content.gsub!('<a href="/', "<a href=\"/#{target_version}/")
95-
File.write('navigation.html', content)
94+
unless target_version == default_rails_version
95+
content = File.read('navigation.html')
96+
content.gsub!('<a href="/', "<a href=\"/#{target_version}/")
97+
File.write('navigation.html', content)
98+
end
9699
end
97100
end
98101

0 commit comments

Comments
 (0)