Skip to content

Commit

Permalink
Fixed turning off search, especially for pagefind format
Browse files Browse the repository at this point in the history
  • Loading branch information
harrymkt authored Jan 4, 2025
1 parent 1d7585b commit 8290dd5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{%- set searchfm = config.extra.search.format %}
{%- set searchfms = ["pagefind", "lunr"] %}
{%- if searchfm not in searchfms %}
{{- throw(message = "Search format (" ~ searchfm ~ ") is invalid.") }}
{{- throw(message = "Search format (" ~ searchfm ~ ") is invalid.") }}
{%- endif %}
{%- set search = false %}
{%- if config.extra.search.enable and (ctx.extra.search | default(value = config.extra.search.default_enable)) %}
Expand Down Expand Up @@ -74,7 +74,7 @@ <h2>{{tran::get(tr = tr, key = "main_menu", def = "Main menu")}}</h2>
</nav>
{%- endif %}
{%- endblock nav %}
<main id="mainc"{% if search %} data-pagefind-body{% endif %}>
<main id="mainc"{% if search and searchfm == "pagefind" %} data-pagefind-body{% endif %}>
{%- block main %}
{%- endblock main -%}
</main>
Expand Down

0 comments on commit 8290dd5

Please sign in to comment.