Skip to content

Commit

Permalink
ensure we have a search UI
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
  • Loading branch information
vsoch committed Apr 24, 2022
1 parent 9f249eb commit ba52bbb
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 18 deletions.
2 changes: 0 additions & 2 deletions 2.analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def get_parser():
layout: table
permalink: /analysis/%s/
tipue_search_active: true
exclude_from_search: true
---
"""

Expand All @@ -73,7 +72,6 @@ def get_parser():
title: %s
layout: repo
tipue_search_active: true
exclude_from_search: true
---
"""

Expand Down
6 changes: 6 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ defaults:
values:
layout: "page"

# Search
tipue_search:
include:
collections:
- repos

user:
avatar: "/assets/img/logo.png"
github: "vsoch"
Expand Down
17 changes: 1 addition & 16 deletions assets/tipuesearch/tipuesearch_content.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,7 @@ layout: null
{%- for collection in site.tipue_search.include.collections -%}
{%- assign documents = site.documents | where:"collection",collection -%}
{%- for document in documents -%}
{%- unless document.exclude_from_search == true or excluded_files contains document.path -%}
{%- assign has_excluded_taxonomy = false -%}
{%- for tag in document.tags -%}
{%- if excluded_taxonomies contains tag -%}
{%- assign has_excluded_taxonomy = true -%}
{%- endif -%}
{%- endfor -%}
{%- for category in document.categories -%}
{%- if excluded_taxonomies contains category -%}
{%- assign has_excluded_taxonomy = true -%}
{%- endif -%}
{%- endfor -%}
{%- unless has_excluded_taxonomy == true -%}
{%- assign index = index | push: document | uniq -%}
{%- endunless -%}
{%- endunless -%}
{%- assign index = index | push: document | uniq -%}
{%- endfor -%}
{%- endfor -%}
var tipuesearch = {"pages": [
Expand Down
23 changes: 23 additions & 0 deletions pages/search.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: Search
description: "Search"
layout: default
permalink: /search
tipue_search_active: true
exclude_from_search: true
---

<div class="row" style="margin:25px; padding:30px">
<div class="col-lg-9">
<div id="tipue_search_content"></div>
</div>
<div class="col-lg-3">
<div class="list-group">
{% for tag in tags %}
<a href="{{ site.baseurl }}/search?q={{ tag }}" class="list-group-item">
<h4 class="list-group-item-heading" style="font-weight:600;color:{% include darkcolors.html %}">{{ tag }}</h4>
</a>
{% endfor %}
</div>

</div>

0 comments on commit ba52bbb

Please sign in to comment.