Skip to content

Commit

Permalink
fix: Do not load the script in 404 page (#200)
Browse files Browse the repository at this point in the history
Fixed #199
  • Loading branch information
reuixiy authored Jun 14, 2020
1 parent 0c2f6c0 commit 87e8586
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions assets/js/lunr-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ window.addEventListener("DOMContentLoaded", event => {

const form = document.getElementById("search");
const input = document.getElementById("search-input");

form.addEventListener("submit", function(event) {
event.preventDefault();

Expand Down
2 changes: 1 addition & 1 deletion layouts/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ <h1>{{ i18n "pageNotFound" }}</h1>
</main>
</div>
</body>
</html>
</html>
4 changes: 3 additions & 1 deletion layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
{{- partial "style.html" . }}

<!-- JavaScript -->
{{ partial "script.html" . }}
{{ if ne .Kind "404" }}
{{ partial "script.html" . }}
{{ end }}

<!-- Fonts -->
{{- with .Site.Params.fontsLink -}}
Expand Down

0 comments on commit 87e8586

Please sign in to comment.