feat(seo): Use h2 header for discussions on discussions list (#3731)

* Use H2 header for discussions on discussions list.

* Put `DiscussionListPane` in `aside` tag to indicate that its content should not be treated as part of discussion content.

* Update markup for views generated by PHP.
This commit is contained in:
Robert Korulczyk 2023-02-15 17:26:43 +01:00 committed by GitHub
parent 1ee5cf6ba9
commit 37fd218723
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View File

@ -117,7 +117,7 @@ export default class DiscussionListItem<CustomAttrs extends IDiscussionListItemA
<ul className="DiscussionListItem-badges badges">{listItems(discussion.badges().toArray())}</ul>
<Link href={app.route.discussion(discussion, jumpTo)} className="DiscussionListItem-main">
<h3 className="DiscussionListItem-title">{highlight(discussion.title(), this.highlightRegExp)}</h3>
<h2 className="DiscussionListItem-title">{highlight(discussion.title(), this.highlightRegExp)}</h2>
<ul className="DiscussionListItem-info">{listItems(this.infoItems().toArray())}</ul>
</Link>
{this.replyCountItem()}

View File

@ -22,7 +22,7 @@ export default class DiscussionListPane extends Component {
return;
}
return <div className="DiscussionPage-list">{this.enoughSpace() && <DiscussionList state={this.attrs.state} />}</div>;
return <aside className="DiscussionPage-list">{this.enoughSpace() && <DiscussionList state={this.attrs.state} />}</aside>;
}
oncreate(vnode) {

View File

@ -1,15 +1,15 @@
<div class="container">
<h2>{{ $apiDocument->data->attributes->title }}</h2>
<h1>{{ $apiDocument->data->attributes->title }}</h1>
<div>
@foreach ($posts as $post)
<div>
<article>
@php $user = ! empty($post->relationships->user->data) ? $getResource($post->relationships->user->data) : null; @endphp
<h3>{{ $user ? $user->attributes->displayName : $translator->trans('core.lib.username.deleted_text') }}</h3>
<div class="Post-body">
{!! $post->attributes->contentHtml !!}
</div>
</div>
</article>
<hr>
@endforeach

View File

@ -1,7 +1,7 @@
@inject('url', 'Flarum\Http\UrlGenerator')
<div class="container">
<h2>{{ $translator->trans('core.views.index.all_discussions_heading') }}</h2>
<h1>{{ $translator->trans('core.views.index.all_discussions_heading') }}</h1>
<ul>
@foreach ($apiDocument->data as $discussion)