Skip to content

Commit

Permalink
feat(seo): Use h2 header for discussions on discussions list (#3731)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
rob006 authored Feb 15, 2023
1 parent 1ee5cf6 commit 37fd218
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions framework/core/views/frontend/content/discussion.blade.php
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion framework/core/views/frontend/content/index.blade.php
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit 37fd218

Please sign in to comment.