mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-25 01:53:44 +03:00
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 <max.krumpe@uniserv.com>
This commit is contained in:
parent
ff91768879
commit
2b72dc0e90
|
@ -8,7 +8,7 @@ describe('Menu', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should sync active menu items while scroll', () => {
|
it('should sync active menu items while scroll', () => {
|
||||||
cy.contains('h1', 'Introduction')
|
cy.contains('h2', 'Introduction')
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.get('[role=menuitem] > label.active')
|
.get('[role=menuitem] > label.active')
|
||||||
.should('have.text', 'Introduction');
|
.should('have.text', 'Introduction');
|
||||||
|
@ -35,7 +35,7 @@ describe('Menu', () => {
|
||||||
|
|
||||||
cy.contains('h1', 'Swagger Petstore').scrollIntoView().wait(100);
|
cy.contains('h1', 'Swagger Petstore').scrollIntoView().wait(100);
|
||||||
|
|
||||||
cy.contains('h1', 'Introduction')
|
cy.contains('h2', 'Introduction')
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.wait(100)
|
.wait(100)
|
||||||
.get('[role=menuitem] > label.active')
|
.get('[role=menuitem] > label.active')
|
||||||
|
|
|
@ -3,7 +3,7 @@ import * as React from 'react';
|
||||||
|
|
||||||
import { ExternalDocumentation } from '../ExternalDocumentation/ExternalDocumentation';
|
import { ExternalDocumentation } from '../ExternalDocumentation/ExternalDocumentation';
|
||||||
import { AdvancedMarkdown } from '../Markdown/AdvancedMarkdown';
|
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 { ContentItemModel } from '../../services';
|
||||||
import type { GroupModel, OperationModel } from '../../services/models';
|
import type { GroupModel, OperationModel } from '../../services/models';
|
||||||
import { Operation } from '../Operation/Operation';
|
import { Operation } from '../Operation/Operation';
|
||||||
|
@ -68,7 +68,7 @@ export class SectionItem extends React.Component<ContentItemProps> {
|
||||||
render() {
|
render() {
|
||||||
const { name, description, externalDocs, level } = this.props.item as GroupModel;
|
const { name, description, externalDocs, level } = this.props.item as GroupModel;
|
||||||
|
|
||||||
const Header = level === 2 ? H2 : H1;
|
const Header = level === 2 ? H3 : H2;
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Row>
|
<Row>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user