clickable link in search results

This commit is contained in:
crunk 2024-06-29 15:41:31 +02:00
parent d9d33a877a
commit b6313e2dc4
2 changed files with 4 additions and 3 deletions

View File

@ -15,6 +15,7 @@ searchpages = Blueprint(
SCRIPT_DIR = os.path.dirname(__file__)
SEARCH_DATA_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "searchdata"))
@searchpages.route("/", methods=["GET", "POST"])
def searchpage():
searchform = SearchForm()
@ -31,7 +32,7 @@ def searchpage():
def search(searchinput):
"""search and get search result titles and return them as distribusi ids"""
ix = open_dir(SEARCH_DATA_DIRgi)
ix = open_dir(SEARCH_DATA_DIR)
with ix.searcher() as searcher:
query = QueryParser("content", ix.schema).parse(searchinput)
search_results = searcher.search(query)

View File

@ -15,8 +15,8 @@
</fieldset>
</form>
<div class="searchresults">
{% for found_distribusis in found_distribusis %}
<p>{{found_distribusis}}</p>
{% for found_distribusi in found_distribusis %}
<a href='{{ url_for('shortstashurl')}}/{{found_distribusi}}/index.html'>{{found_distribusi}}</a>
{% endfor %}
</div>
</div>