Skip to content

Commit

Permalink
chore: add score to search and bold current location in nav
Browse files Browse the repository at this point in the history
  • Loading branch information
leggetter committed Sep 19, 2024
1 parent b64f538 commit 24fd037
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 7 additions & 3 deletions templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@
justify-content: center;
list-style: none;
padding: 0;
gap: 10px;
gap: 30px;
}

.topnav a.current {
font-weight: bolder;
}

h2 {
Expand Down Expand Up @@ -136,8 +140,8 @@ <h1>Index All The Things!</h1>

<nav class="topnav">
<ul>
<li><a href="/">Index a Thing</a></li>
<li><a href="/search">Search for Things</a></li>
<li><a href="/" class="{{ 'current' if request.path == '/' else '' }}">Index a Thing</a></li>
<li><a href="/search" class="{{ 'current' if request.path == '/search' else '' }}">Search for Things</a></li>
</ul>
</nav>
</div>
Expand Down
2 changes: 2 additions & 0 deletions templates/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ <h2>Results {% if query %}for "{{ query }}"{% endif %}:</h2>
<table>
<thead>
<tr>
<th>Score</th>
<th>Domain</th>
<th>Path</th>
<th>Content Type</th>
Expand All @@ -46,6 +47,7 @@ <h2>Results {% if query %}for "{{ query }}"{% endif %}:</h2>
<tbody>
{% for asset in results %}
<tr data-url="{{ asset.url }}">
<td>{{ asset.score }}</td>
<td title="{{ asset.url }}">{{ asset.parsed_url.hostname }}</td>
<td class="path" title="{{ asset.parsed_url.path }}">
<span>...{{ asset.parsed_url.last_part }}</span>
Expand Down

0 comments on commit 24fd037

Please sign in to comment.