Skip to content

Commit 2fd3e74

Browse files
committed
Enable pagefind only in production (not localhost)
1 parent 44e682a commit 2fd3e74

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

_includes/footer.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ <h3 class="footer-heading">{{ site.title }}</h3>
4949
<p class="text">{{ site.description }}</p>
5050
</div>
5151
</div>
52-
{% if jekyll.environment == "production" %}
52+
53+
{% unless site.url contains "localhost" %}
5354
<link href="/pagefind/pagefind-ui.css" rel="stylesheet">
5455
<script src="/pagefind/pagefind-ui.js"></script>
5556
<div id="search"></div>
@@ -58,7 +59,7 @@ <h3 class="footer-heading">{{ site.title }}</h3>
5859
new PagefindUI({ element: "#search", showSubResults: true });
5960
});
6061
</script>
61-
{% endif %}
62+
{% endunless %}
6263
</div>
6364

6465
</footer>

0 commit comments

Comments
 (0)