Skip to content

Commit 14c868f

Browse files
committed
fix: Generate correct navigation.html for Rails 7.1
- Update navigation.html for Rails v7.1
1 parent e405750 commit 14c868f

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
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

src/7.1/navigation.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)