mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-24 03:58:49 +02:00
feat(eslint-plugin): new prefer-docusaurus-heading rule (#8384)
This commit is contained in:
parent
a53d4cb2b3
commit
90e7e321d1
31 changed files with 254 additions and 52 deletions
|
@ -33,7 +33,7 @@ import {
|
|||
useSearchResultUrlProcessor,
|
||||
} from '@docusaurus/theme-search-algolia/client';
|
||||
import Layout from '@theme/Layout';
|
||||
|
||||
import Heading from '@theme/Heading';
|
||||
import styles from './styles.module.css';
|
||||
|
||||
// Very simple pluralization: probably good enough for now
|
||||
|
@ -374,7 +374,7 @@ function SearchPageContent(): JSX.Element {
|
|||
</Head>
|
||||
|
||||
<div className="container margin-vert--lg">
|
||||
<h1>{getTitle()}</h1>
|
||||
<Heading as="h1">{getTitle()}</Heading>
|
||||
|
||||
<form className="row" onSubmit={(e) => e.preventDefault()}>
|
||||
<div
|
||||
|
@ -455,9 +455,9 @@ function SearchPageContent(): JSX.Element {
|
|||
{searchResultState.items.map(
|
||||
({title, url, summary, breadcrumbs}, i) => (
|
||||
<article key={i} className={styles.searchResultItem}>
|
||||
<h2 className={styles.searchResultItemHeading}>
|
||||
<Heading as="h2" className={styles.searchResultItemHeading}>
|
||||
<Link to={url} dangerouslySetInnerHTML={{__html: title}} />
|
||||
</h2>
|
||||
</Heading>
|
||||
|
||||
{breadcrumbs.length > 0 && (
|
||||
<nav aria-label="breadcrumbs">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue