Skip to content

Commit

Permalink
Add comment counts to search results
Browse files Browse the repository at this point in the history
  • Loading branch information
themkat committed Aug 14, 2024
1 parent 0deb969 commit 30780fb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions _sass/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,16 @@ body {

#search-result-container div {
cursor: pointer;

h3 {
margin: 0;
}

a {
font-size: medium;
text-decoration: none;
float: right;
}
}

.printbutton {
Expand Down
4 changes: 4 additions & 0 deletions search.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ <h2 id="search-page-title">Are you not searching for anything? Enable JS or some
const heading = document.createElement('h3');
heading.innerHTML = (elem.score > goodScoreLimit ? ':trophy: ' : '') + elem.title;
resultEntry.appendChild(heading);

const comments = document.createElement('a');
comments.href = `{{site.url}}${elem.url}#commento`;
resultEntry.appendChild(comments);

const excerpt = document.createElement('p');
excerpt.innerHTML = elem.excerpt;
Expand Down

0 comments on commit 30780fb

Please sign in to comment.