diff options
author | johannst <johannes.stoelp@gmail.com> | 2021-05-11 01:48:40 +0200 |
---|---|---|
committer | johannst <johannes.stoelp@gmail.com> | 2021-05-12 00:03:09 +0200 |
commit | 53c9ba85bf18e53a7d998c048d10e578b5a19983 (patch) | |
tree | f047de9db752900f33192b8dc76baea02a25a5f5 /templates | |
parent | beac9714ef693f97feb68e1793fa1ad30d8a96e4 (diff) | |
download | blog-53c9ba85bf18e53a7d998c048d10e578b5a19983.tar.gz blog-53c9ba85bf18e53a7d998c048d10e578b5a19983.zip |
added search input with simple search result preview
Diffstat (limited to 'templates')
-rw-r--r-- | templates/index.html | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/templates/index.html b/templates/index.html index bc5cca2..ad0d413 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,3 +1,5 @@ +<!-- Override derived from hyde theme: https://github.com/getzola/hyde.git --> + <!DOCTYPE html> <html lang="en"> <head> @@ -44,14 +46,24 @@ {% endfor %} {% endblock sidebar_nav %} </ul> + + <!-- johannst START --> + <div class="search-container"> + <input id="search" type="search" placeholder="🔎 Search"> + </div> + <!-- johannst END --> </div> </div> {% endblock sidebar %} - <div class="content container"> + <!-- johannst: START | add id --> + <div class="content container" id="pages"> + <!-- johannst: END --> {% block content %} <div class="posts"> - {% for page in section.pages | reverse %} + <!-- johannst: START | remove `reverse` --> + {% for page in section.pages %} + <!-- johannst: END --> <div class="post"> <h1 class="post-title"> <a href="{{ page.permalink }}"> @@ -66,6 +78,15 @@ {% endblock content %} </div> + <!-- johannst START --> + <div class="content container" id="search-results"> + <div id="search-results-items"></div> + </div> + + <script type="text/javascript" src="{{ get_url(path="elasticlunr.min.js") }}"></script> + <script type="text/javascript" src="{{ get_url(path="search_index.en.js") }}"></script> + <script type="text/javascript" src="{{ get_url(path="search.js") }}"></script> + <!-- johannst END --> </body> </html> |