diff options
author | amzrk2 | 2020-06-16 14:00:53 +0800 |
---|---|---|
committer | amzrk2 | 2020-06-16 14:00:53 +0800 |
commit | c42924047c6f654c4723746790e041f8907ed378 (patch) | |
tree | 9d826ac811c3861da8ce9e7938d35a3147f4db36 /layouts/partials/scripts-end.html | |
parent | e7587236dbe98775315619d4f3b8d3f335001583 (diff) | |
download | hugo-theme-fuji-c42924047c6f654c4723746790e041f8907ed378.tar.gz hugo-theme-fuji-c42924047c6f654c4723746790e041f8907ed378.tar.bz2 hugo-theme-fuji-c42924047c6f654c4723746790e041f8907ed378.zip |
Searching now works
Diffstat (limited to 'layouts/partials/scripts-end.html')
-rw-r--r-- | layouts/partials/scripts-end.html | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/layouts/partials/scripts-end.html b/layouts/partials/scripts-end.html index 69c5dca..2959beb 100644 --- a/layouts/partials/scripts-end.html +++ b/layouts/partials/scripts-end.html @@ -2,27 +2,8 @@ <script async nomodule src="https://cdn.jsdelivr.net/npm/ionicons@5.0.1/dist/ionicons/ionicons.js"></script> {{ if eq .Section "search" }} -<script src="https://cdn.jsdelivr.net/npm/fuse.js@6.1.0/dist/fuse.js"></script> -<!-- Search result template --> -<script src="https://cdn.jsdelivr.net/npm/art-template@4.13.2/lib/template-web.min.js"></script> -<script id="search-result-template" type="text/fuse-template"> - {{ "<% for(var i = 0; i < $data.length; i++){ %>" | safeHTML }} - <div class="post"> - <h3 class="post-item post-title-archive"> - <a href="<%= $data[i].item.permalink %>">{{ "<%= $data[i].item.title %>" | safeHTML }}</a> - </h3> - <div class="post-item post-meta-archive"> - {{ "<% if ($data[i].item.tags && $data[i].item.tags.length > 0) { %>" | safeHTML }} - {{ "<% for(var j = 0; j < $data[i].item.tags.length; j++){ %>" | safeHTML }} - {{ "<%= $data[i].item.tags[j] %>" | safeHTML }} - {{ "<% } %>" | safeHTML }} - {{ "<% } else { %>" | safeHTML }} - No Tag - {{ "<% } %>" | safeHTML }} - </div> - </div> - {{ "<% } %>" | safeHTML }} -</script> +<script defer src="https://cdn.jsdelivr.net/npm/fuse.js@6.1.0/dist/fuse.js"></script> +<script defer src="https://cdn.jsdelivr.net/npm/art-template@4.13.2/lib/template-web.min.js"></script> {{ else if eq .Section "archives" }} {{ else }} <script defer src="https://cdn.jsdelivr.net/npm/prismjs@1.20.0/components/prism-core.min.js"></script> @@ -37,6 +18,7 @@ <!-- prettier-ignore --> <script> // in-post aplayer + /* beautify preserve:start */ var aPlayer = new APlayer({ container: document.getElementById('post-aplayer'), theme: '#8f82bc', @@ -49,8 +31,9 @@ url: '{{ .playerURL }}', cover: '{{ .playerCover }}' }, - {{- end -}} + {{- end -}}] }); + /* beautify preserve:end */ // aplayer toc anchors fix // see https://github.com/MoePlayer/APlayer/issues/242#issuecomment-602471423 document.addEventListener('DOMContentLoaded', function () { |