Skip to content

Commit

Permalink
perf: use semantic tags for search-results & 404 page
Browse files Browse the repository at this point in the history
  • Loading branch information
cotes2020 committed Sep 8, 2023
1 parent 5281111 commit 8b59a02
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
18 changes: 10 additions & 8 deletions _includes/search-loader.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@
-->

{% capture result_elem %}
<div class="px-1 px-sm-2 px-lg-4 px-xl-0">
<a href="{url}">{title}</a>
<div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
{categories}
{tags}
</div>
<p>{snippet}</p>
</div>
<article class="px-1 px-sm-2 px-lg-4 px-xl-0">
<header>
<h2><a href="{url}">{title}</a></h2>
<div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
{categories}
{tags}
</div>
</header>
<p>{snippet}</p>
</article>
{% endcapture %}

{% capture not_found %}<p class="mt-5">{{ site.data.locales[include.lang].search.no_results }}</p>{% endcapture %}
Expand Down
6 changes: 3 additions & 3 deletions _sass/addon/commons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,7 @@ search {
line-height: 2.5rem;
}

> div {
> article {
width: 100%;

&:not(:last-child) {
Expand Down Expand Up @@ -1428,8 +1428,8 @@ search {
transition: all 0.3s ease-in-out;
}

#search-results > div {
width: 46%;
#search-results > article {
width: 45%;

&:nth-child(odd) {
margin-right: 1.5rem;
Expand Down
4 changes: 1 addition & 3 deletions assets/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@

{% include lang.html %}

<div class="lead">
<p>{{ site.data.locales[lang].not_found.statment }}</p>
</div>
<p class="lead">{{ site.data.locales[lang].not_found.statment }}</p>

0 comments on commit 8b59a02

Please sign in to comment.