Skip to content

Commit

Permalink
fix: use h2/h3 for headings instead of h1/h2 for better seo (#2514)
Browse files Browse the repository at this point in the history
* 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 <max.krumpe@uniserv.com>
  • Loading branch information
maxkrumpe and mxkrmp committed Apr 25, 2024
1 parent ff91768 commit 2b72dc0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions e2e/integration/menu.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('Menu', () => {
});

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

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

cy.contains('h1', 'Introduction')
cy.contains('h2', 'Introduction')
.scrollIntoView()
.wait(100)
.get('[role=menuitem] > label.active')
Expand Down
4 changes: 2 additions & 2 deletions src/components/ContentItems/ContentItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as React from 'react';

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

const Header = level === 2 ? H2 : H1;
const Header = level === 2 ? H3 : H2;
return (
<>
<Row>
Expand Down

0 comments on commit 2b72dc0

Please sign in to comment.