From 44a068837b90097ed6da8a930e3b89155473ff96 Mon Sep 17 00:00:00 2001 From: Bobby Date: Sun, 11 Feb 2024 17:19:47 -0500 Subject: Disallow Empty Search + Basic Article Improvements --- blog/views.py | 1 + static/css/styles.css | 10 ++++++++++ templates/blog/partials/base.html | 1 + templates/blog/search.html | 8 +++++++- 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/blog/views.py b/blog/views.py index a1e1455b..8dc8fe60 100644 --- a/blog/views.py +++ b/blog/views.py @@ -183,6 +183,7 @@ def post(request, slug): first_paragraph = soup.find('p') if first_paragraph is not None: first_paragraph = str(first_paragraph) + first_paragraph = first_paragraph.replace('

', '

') soup.find('p').decompose() post.first_paragraph = first_paragraph diff --git a/static/css/styles.css b/static/css/styles.css index 80fc4813..800d7d09 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -528,3 +528,13 @@ blockquote { max-width: 300px; } } + +.subhead { + initial-letter: 2; +} + +.subhead::first-letter { + initial-letter: 2; + margin: 0 10px 0 0; +} + diff --git a/templates/blog/partials/base.html b/templates/blog/partials/base.html index 207d29a1..3db00ea9 100644 --- a/templates/blog/partials/base.html +++ b/templates/blog/partials/base.html @@ -88,6 +88,7 @@ placeholder="Search..." autocomplete="off" value="{{ request.GET.q }}" + required /> diff --git a/templates/blog/search.html b/templates/blog/search.html index 33a41b14..721f8d8d 100644 --- a/templates/blog/search.html +++ b/templates/blog/search.html @@ -27,8 +27,14 @@ - +

Search Results

+

Your search for "{{ request.GET.q }}" returned {{ search_results }} Result{% if search_results != 1 %}s{% endif %}.

{% if 'posts' in search_in %} -- cgit v1.2.3