Skip to content

Commit 2b72dc0

Browse files
maxkrumpemxkrmp
andauthored
fix: use h2/h3 for headings instead of h1/h2 for better seo (#2514)
* fix: use h2/h3 for headings instead of h1/h2 for better seo * fix: fixed e2e tests for changed headings --------- Co-authored-by: Max Krumpe <[email protected]>
1 parent ff91768 commit 2b72dc0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

e2e/integration/menu.e2e.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('Menu', () => {
88
});
99

1010
it('should sync active menu items while scroll', () => {
11-
cy.contains('h1', 'Introduction')
11+
cy.contains('h2', 'Introduction')
1212
.scrollIntoView()
1313
.get('[role=menuitem] > label.active')
1414
.should('have.text', 'Introduction');
@@ -35,7 +35,7 @@ describe('Menu', () => {
3535

3636
cy.contains('h1', 'Swagger Petstore').scrollIntoView().wait(100);
3737

38-
cy.contains('h1', 'Introduction')
38+
cy.contains('h2', 'Introduction')
3939
.scrollIntoView()
4040
.wait(100)
4141
.get('[role=menuitem] > label.active')

src/components/ContentItems/ContentItems.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as React from 'react';
33

44
import { ExternalDocumentation } from '../ExternalDocumentation/ExternalDocumentation';
55
import { AdvancedMarkdown } from '../Markdown/AdvancedMarkdown';
6-
import { H1, H2, MiddlePanel, Row, Section, ShareLink } from '../../common-elements';
6+
import { H2, H3, MiddlePanel, Row, Section, ShareLink } from '../../common-elements';
77
import type { ContentItemModel } from '../../services';
88
import type { GroupModel, OperationModel } from '../../services/models';
99
import { Operation } from '../Operation/Operation';
@@ -68,7 +68,7 @@ export class SectionItem extends React.Component<ContentItemProps> {
6868
render() {
6969
const { name, description, externalDocs, level } = this.props.item as GroupModel;
7070

71-
const Header = level === 2 ? H2 : H1;
71+
const Header = level === 2 ? H3 : H2;
7272
return (
7373
<>
7474
<Row>

0 commit comments

Comments
 (0)