Skip to content

Generate docs for Rails v7.0, v7.1 / docs: Add badges #156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: Generate correct navigation.html for Rails 7.1
- Update navigation.html for Rails v7.1
  • Loading branch information
toshimaru committed Jul 6, 2024
commit 14c868f021e0c956ee0972a5500843c43c3a3f1f
13 changes: 8 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,19 @@ def generate_src(target_version:)
cp_r copy_sources, target_dir

cd target_dir do
# Generate index.html
if Gem::Version.new(target_version) >= Gem::Version.new('7.1')
cp NEW_INDEX_HTML, 'index.html'
return
else
cp INDEX_HTML, 'index.html'
end

cp INDEX_HTML, 'index.html'
# Prepend version number to the absolute path in navigation.html
content = File.read('navigation.html')
content.gsub!('<a href="/', "<a href=\"/#{target_version}/")
File.write('navigation.html', content)
unless target_version == default_rails_version
content = File.read('navigation.html')
content.gsub!('<a href="/', "<a href=\"/#{target_version}/")
File.write('navigation.html', content)
end
end
end

Expand Down
2 changes: 1 addition & 1 deletion src/7.1/navigation.html

Large diffs are not rendered by default.