38 lines
1.7 KiB
HTML
38 lines
1.7 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Search · {{ site_title }}{% endblock %}
|
|
{% block meta_description %}Search {{ site_title }}.{% endblock %}
|
|
{% block robots %}noindex, follow{% endblock %}
|
|
|
|
{% block content %}
|
|
<h1 class="page-heading">Search</h1>
|
|
<form class="search-form" method="get" action="{{ url_for('public.search') }}">
|
|
<input type="search" name="q" placeholder="Search posts…" value="{{ query }}" aria-label="Search">
|
|
<button type="submit">Search</button>
|
|
</form>
|
|
|
|
{% if query %}
|
|
<h2 class="page-heading" style="font-size:1.3rem;">Results for “{{ query }}”</h2>
|
|
<div class="posts-grid">
|
|
{% for p in posts %}
|
|
<article class="post-card">
|
|
<h2><a href="{{ url_for('public.post', slug=p.slug) }}">{{ p.title }}</a></h2>
|
|
<div class="post-meta"><span><strong>{{ parse_date(p.created_at) }}</strong></span><span>by {{ p.author }}</span></div>
|
|
{% if p.excerpt %}<div class="post-excerpt">{{ p.excerpt|replace("\n", "\n\n")|safe }}</div>{% endif %}
|
|
<div class="post-footer">
|
|
<div class="post-tax">
|
|
{% if p.category %}<span class="term">{{ p.category }}</span> · {% endif %}
|
|
{% for t in p.tags|tag_list %}
|
|
<a class="term" href="{{ url_for('public.tag', slug=t.slug) }}">{{ t.name }}</a>
|
|
{% endfor %}
|
|
</div>
|
|
<a class="read-more" href="{{ url_for('public.post', slug=p.slug) }}">Read more →</a>
|
|
</div>
|
|
</article>
|
|
{% else %}
|
|
<p class="empty-state">No posts matched “{{ query }}”.</p>
|
|
{% endfor %}
|
|
</div>
|
|
{% include "_pagination.html" %}
|
|
{% endif %}
|
|
{% endblock %}
|