Skip to content

Commit

Permalink
Improved search and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
x1y committed Sep 29, 2024
1 parent c60a37d commit e35ea0d
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 43 deletions.
20 changes: 0 additions & 20 deletions themes/pinetheme/LICENSE

This file was deleted.

3 changes: 2 additions & 1 deletion themes/pinetheme/assets/css/documentation.css
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ div#doc-page h1 {
div#doc-page code {
font-family: source code pro, lucida console, monospace;
display: inline-block;
overflow-x: auto;
overflow-x: scroll;
font-weight: 400;
max-width: 98%;
vertical-align: top;
Expand All @@ -134,6 +134,7 @@ div#doc-page p code {
}
div#doc-page pre {
background-color: #f8f9fa;
overflow-x: scroll;
outline: 1px solid #eaecf0;
}
div#doc-page td pre {
Expand Down
File renamed without changes.
9 changes: 9 additions & 0 deletions themes/pinetheme/assets/js/fuse/fuse.min.js

Large diffs are not rendered by default.

File renamed without changes.
13 changes: 13 additions & 0 deletions themes/pinetheme/assets/js/mark/mark.min.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ var fuseOptions = {
shouldSort: true,
includeMatches: true,
includeScore: true,
tokenize: true,
location: 0,
distance: 100,
minMatchCharLength: 1,
keys: [
{name: "title", weight: 0.65},
{name: "title", weight: 0.85},
{name: "contents", weight: 0.5},
{name: "tags", weight: 0.08},
{name: "categories", weight: 0.05}
Expand Down Expand Up @@ -83,6 +82,7 @@ function populateResults(results) {

var output = render(templateDefinition, {
key: key,
location: value.item.permalink.split('//')[1].split('/').slice(1, -2).join(' / ').replace(/_/g, ' '),
title: value.item.title,
link: value.item.permalink,
tags: tags,
Expand Down
11 changes: 7 additions & 4 deletions themes/pinetheme/layouts/_default/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ <h1>{{ .Title }}</h1>

<script id="search-result-template" type="text/x-js-template">
<div id="summary-${key}">
<h3><a href="${link}">${title}</a></h3>
<h3><a href="${link}">${location} / ${title}</a></h3>
<p>${snippet}</p>
<p>
<small>
Expand All @@ -72,9 +72,12 @@ <h3><a href="${link}">${title}</a></h3>
</div>
</script>

<script src='{{ "js/fuse/fuse.min.js" | absURL }}' integrity="sha512-Nqw1tH3mpavka9cQCc5zWWEZNfIPdOYyQFjlV1NvflEtQ0/XI6ZQ+H/D3YgJdqSUJlMLAPRj/oXlaHCFbFCjoQ=="></script>
<script src='{{ "js/mark/mark.min.js" | absURL }}' integrity="sha512-5CYOlHXGh6QpOFA/TeTylKLWfB3ftPsde7AnmhuitiTX4K5SqCLBeKro6sPS8ilsz1Q4NRx3v8Ko2IBiszzdww=="></script>
<script src='{{ "js/search.js" | absURL }}'></script>
{{- $js_fuse := resources.Get "js/fuse/fuse.min.js" | minify | fingerprint -}}
<script src='{{ $js_fuse.Permalink }}' integrity="{{ $js_fuse.Data.Integrity }}"></script>
{{- $js_mark := resources.Get "js/mark/mark.min.js" | minify | fingerprint -}}
<script src='{{ $js_mark.Permalink }}' integrity="{{ $js_mark.Data.Integrity }}"></script>
{{- $js_search := resources.Get "js/search.js" | minify | fingerprint -}}
<script src='{{ $js_search.Permalink }}' integrity="{{ $js_search.Data.Integrity }}"></script>
</div>

{{ end }}
9 changes: 0 additions & 9 deletions themes/pinetheme/static/js/fuse/fuse.min.js

This file was deleted.

7 changes: 0 additions & 7 deletions themes/pinetheme/static/js/mark/mark.min.js

This file was deleted.

0 comments on commit e35ea0d

Please sign in to comment.