Skip to content

Commit 03b1acd

Browse files
committed
Fix documentation H1 headings for improved search indexing
Add missing H1 headings and improve H1 quality across 10 documentation files to enable proper Algolia search indexing and improve accessibility. Critical fixes (missing H1): - configuration.md: Add "React on Rails Configuration Options" - react-on-rails-pro.md: Change H2 to H1 - rails-engine-integration.md: Add "Integrating React on Rails with Rails Engines" - troubleshooting-when-using-webpacker.md: Add H1 and fix structure - troubleshooting-when-using-shakapacker.md: Add H1 and fix heading hierarchy - credits.md: Add "React on Rails Credits and Authors" Quality improvements (better searchability): - images.md: "Images" → "Configuring Images and Assets with Webpack" - foreman-issues.md: "Foreman Issues" → "Troubleshooting Foreman with React on Rails" - updating-dependencies.md: "Updating Dependencies" → "Updating Ruby and JavaScript Dependencies" - api-reference/README.md: "API Reference" → "React on Rails API Reference Guide" Why: Algolia indexes H1 as primary title. Files without H1 show as "Untitled" in search results. Generic H1s reduce searchability. Reference: docs/planning/docs-improvement/h1-headings-audit-report.md (local file, not tracked)
1 parent 17f8dc7 commit 03b1acd

File tree

10 files changed

+23
-13
lines changed

10 files changed

+23
-13
lines changed

docs/advanced-topics/rails-engine-integration.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Integrating React on Rails with Rails Engines
2+
13
## In your engine
24

35
- At the top of `config/initializers/react_on_rails.rb`

docs/api-reference/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# API Reference
1+
# React on Rails API Reference Guide
22

33
Complete API documentation for React on Rails.
44

docs/api-reference/configuration.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# React on Rails Configuration Options
2+
13
Here is the full set of config options. This file is `/config/initializers/react_on_rails.rb`
24

35
First, you should have a `/config/shakapacker.yml` setup.

docs/building-features/foreman-issues.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Foreman Issues
1+
# Troubleshooting Foreman with React on Rails
22

33
## It is not recommended to include foreman into Gemfile
44

docs/building-features/images.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Images
1+
# Configuring Images and Assets with Webpack
22

33
1. leading slash necessary on the
44
a. Option name for the file-loader and url-loader (todo reference)

docs/deployment/troubleshooting-when-using-shakapacker.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
# Client rendering crashes when configuring `optimization.runtimeChunk` to `multiple`
1+
# Troubleshooting Shakapacker Configuration Issues
22

3-
## Context
3+
## Client rendering crashes when configuring `optimization.runtimeChunk` to `multiple`
4+
5+
### Context
46

57
1. Ruby version: 3.1
68
2. Rails version: 7.0.6
79
3. Shakapacker version: 6.6.0
810
4. React on Rails version: 13.3.5
911

10-
## The failure
12+
### The failure
1113

1214
Configuring Webpack to embed the runtime in each chunk and calling `react_component` twice in a Rails view/partial causes the client render to crash with the following error:
1315

@@ -27,31 +29,31 @@ VM4859 clientStartup.js:132 Uncaught Error: ReactOnRails encountered an error wh
2729
at HTMLDocument.onReadyStateChange (VM4859 clientStartup.js:238:13)
2830
```
2931

30-
## Configs
32+
### Configs
3133

32-
### Webpack configuration
34+
#### Webpack configuration
3335

3436
```js
3537
optimization: {
3638
runtimeChunk: 'multiple'
3739
},
3840
```
3941

40-
### Rails view
42+
#### Rails view
4143

4244
```haml
4345
= react_component("XXX", props: @props)
4446
= yield
4547
= react_component("YYY", props: @props)
4648
```
4749

48-
## The problem
50+
### The problem
4951

5052
Configuring Webpack to embed the runtime in each chunk and calling `react_component` twice in a Rails view/partial causes the client render to crash.
5153

5254
Read more at https://github.com/shakacode/react_on_rails/issues/1558.
5355

54-
## Solution
56+
### Solution
5557

5658
To overcome this issue, we could use [shakapacker](https://github.com/shakacode/shakapacker)'s default optimization configuration (pseudo-code):
5759

docs/deployment/troubleshooting-when-using-webpacker.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Troubleshooting Webpacker Manifest Errors
2+
13
## Context
24

35
Rails: 5.0.2

docs/misc/credits.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# React on Rails Credits and Authors
2+
13
## Authors
24

35
[The Shaka Code team!](http://www.shakacode.com/about/)

docs/misc/updating-dependencies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Updating Dependencies
1+
# Updating Ruby and JavaScript Dependencies
22

33
If you frequently update dependencies in small batches, you will avoid large and painful updates later. Then again, if you don't have good test coverage, it's hazardous to update dependencies at any time.
44

docs/pro/react-on-rails-pro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## React on Rails Pro
1+
# React on Rails Pro
22

33
Support React on Rails development [by becoming a Github sponsor](https://github.com/sponsors/shakacode) and get these benefits:
44

0 commit comments

Comments
 (0)