Skip to content
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

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

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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: CI

on: [pull_request]
on:
push:
branches:
- main
pull_request:

jobs:
jekyll-build:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# [railsdoc.github.io](https://railsdoc.github.io/)

[![CI](https://github.com/railsdoc/railsdoc.github.io/actions/workflows/ci.yml/badge.svg)](https://github.com/railsdoc/railsdoc.github.io/actions/workflows/ci.yml)
[![Deploy](https://github.com/railsdoc/railsdoc.github.io/actions/workflows/deploy.yml/badge.svg)](https://github.com/railsdoc/railsdoc.github.io/actions/workflows/deploy.yml)
[![Netlify Status](https://api.netlify.com/api/v1/badges/c964029a-6d5a-4f3a-95e9-d35830a2fe83/deploy-status)](https://app.netlify.com/sites/railsdoc-preview/deploys)

railsdoc.github.io is yet another Rails API documentation website.
Expand Down
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
7 changes: 6 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,15 @@ defaults:
- scope:
path: ""
values:
version: 7.1
version: 7.2
image: https://avatars.githubusercontent.com/u/4223
toc: true
root_path: '/'
- scope:
path: "7.1"
values:
version: 7.1
root_path: '/7.1/'
- scope:
path: "7.0"
values:
Expand Down
Loading