diff options
| -rw-r--r-- | blog/views.py | 1 | ||||
| -rw-r--r-- | static/css/styles.css | 10 | ||||
| -rw-r--r-- | templates/blog/partials/base.html | 1 | ||||
| -rw-r--r-- | templates/blog/search.html | 8 |
4 files changed, 19 insertions, 1 deletions
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('<p>', '<p class="subhead">') 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 /> </form> </div> 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 @@ <input type="submit" value="Search" class="button button-special" style="margin: 10px 0;"/> </form> </td> - <td id="search_results" style="width: 530px; vertical-align: top; padding-left: 20px;"> + <td id="search_results" style="width: 530px; max-width: 530px; vertical-align: top; padding-left: 20px;"> <h2>Search Results</h2> + <style> + div > pre { + white-space: pre-wrap; + word-wrap: break-word; + } + </style> <p style="margin-bottom: 20px;">Your search for "<strong>{{ request.GET.q }}</strong>" returned {{ search_results }} Result{% if search_results != 1 %}s{% endif %}.</p> {% if 'posts' in search_in %} |
