Add section, article tags to search layout
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
<section>
|
||||
<div class="container-fluid">
|
||||
<form action="{{ .Page.RelPermalink }}" dir="auto" method="get">
|
||||
<div class="justify-content-center mb-3 row">
|
||||
@@ -40,6 +41,8 @@
|
||||
</i>
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
<article id="paige-results" style="display: none"></article>
|
||||
<script crossorigin="anonymous" defer integrity="sha384-1LalyFI+BycKouEClZE5CoFnlLr+Kx8Wslc45o5NATVo+c2mEh02i8HNaaT7XOdQ" referrerpolicy="no-referrer" src="https://cdn.jsdelivr.net/gh/nextapps-de/flexsearch@0.7.31/dist/flexsearch.bundle.js"></script>
|
||||
<script>
|
||||
var errorElement = document.getElementById("paige-error");
|
||||
@@ -47,6 +50,7 @@ var nothingElement = document.getElementById("paige-nothing");
|
||||
var queryElement = document.getElementById("query");
|
||||
var searchingElement = document.getElementById("paige-searching")
|
||||
var somethingElement = document.getElementById("paige-something");
|
||||
var resultsElement = document.getElementById("paige-results");
|
||||
|
||||
if (queryElement !== null) {
|
||||
var queryText = decodeURIComponent((location.search.split("q=")[1] || "").split("&")[0]).replace(/\+/g, " ");
|
||||
@@ -89,6 +93,7 @@ function search(queryText) {
|
||||
if (!shown) {
|
||||
shown = true;
|
||||
show(somethingElement);
|
||||
show(resultsElement);
|
||||
}
|
||||
done[path] = true;
|
||||
var page = pathPage[path];
|
||||
@@ -102,7 +107,7 @@ function search(queryText) {
|
||||
result.appendChild(document.createElement("br"));
|
||||
result.innerHTML += page.description;
|
||||
}
|
||||
somethingElement.appendChild(result);
|
||||
resultsElement.appendChild(result);
|
||||
});
|
||||
});
|
||||
if (!shown) {
|
||||
|
Reference in New Issue
Block a user