about summary refs log tree commit diff stats
path: root/frontend
diff options
context:
space:
mode:
authorAlan Pearce2024-05-08 17:11:28 +0200
committerAlan Pearce2024-05-08 17:11:28 +0200
commit4c06f763f471f51a655b8437f9529149512e5507 (patch)
tree98cf200da087d81321851121c9440d014e7f7d0c /frontend
parent8537192b854cb4abde7c7ca2d58c201df060504a (diff)
downloadsearchix-4c06f763f471f51a655b8437f9529149512e5507.tar.lz
searchix-4c06f763f471f51a655b8437f9529149512e5507.tar.zst
searchix-4c06f763f471f51a655b8437f9529149512e5507.zip
refactor: enable access to bleve DocumentMatch structs
Diffstat (limited to 'frontend')
-rw-r--r--frontend/templates/blocks/options.gotmpl98
1 files changed, 50 insertions, 48 deletions
diff --git a/frontend/templates/blocks/options.gotmpl b/frontend/templates/blocks/options.gotmpl
index 88553b2..a9c2a1b 100644
--- a/frontend/templates/blocks/options.gotmpl
+++ b/frontend/templates/blocks/options.gotmpl
@@ -2,57 +2,59 @@
 {{- define "results" }}
   {{- if gt .Results.Total 0 }}
     <section id="results">
-      {{- range .Results.Results }}
-        <details id="{{ .Option }}">
-          <summary>
-            {{ .Option }}
-          </summary>
-          <p>
-            {{ markdown .Description }}
-          </p>
-          <dl>
-            {{- with .Type }}
-              <dt>Type</dt>
-              <dd><code>{{ . }}</code></dd>
-            {{- end }}
-            {{- with .Default }}
-              {{- if or .Text .Markdown }}
-                <dt>Default</dt>
-                <dd>
-                  {{- if .Markdown }}
-                    {{ markdown .Markdown }}
-                  {{- else }}
-                    <pre><code>{{ .Text }}</code></pre>
-                  {{- end }}
-                </dd>
+      {{- range .Results.Hits }}
+        {{- with .Data }}
+          <details id="{{ .Option }}">
+            <summary>
+              {{ .Option }}
+            </summary>
+            <p>
+              {{ markdown .Description }}
+            </p>
+            <dl>
+              {{- with .Type }}
+                <dt>Type</dt>
+                <dd><code>{{ . }}</code></dd>
               {{- end }}
-            {{- end }}
-            {{- with .Example }}
-              {{- if or .Text .Markdown }}
-                <dt>Example</dt>
-                <dd>
-                  {{- if .Markdown }}
-                    {{ markdown .Markdown }}
-                  {{- else }}
-                    <pre><code>{{ .Text }}</code></pre>
-                  {{- end }}
-                </dd>
+              {{- with .Default }}
+                {{- if or .Text .Markdown }}
+                  <dt>Default</dt>
+                  <dd>
+                    {{- if .Markdown }}
+                      {{ markdown .Markdown }}
+                    {{- else }}
+                      <pre><code>{{ .Text }}</code></pre>
+                    {{- end }}
+                  </dd>
+                {{- end }}
               {{- end }}
-            {{- end }}
-            {{- with .RelatedPackages }}
-              <dt>Related Packages</dt>
-              <dd>{{ . }}</dd>
-            {{- end }}
-            {{- with .Declarations }}
-              <dt>Declared</dt>
-              {{- range . }}
-                <dd>
-                  <a href="{{ .URL }}">{{ .Name }}</a>
-                </dd>
+              {{- with .Example }}
+                {{- if or .Text .Markdown }}
+                  <dt>Example</dt>
+                  <dd>
+                    {{- if .Markdown }}
+                      {{ markdown .Markdown }}
+                    {{- else }}
+                      <pre><code>{{ .Text }}</code></pre>
+                    {{- end }}
+                  </dd>
+                {{- end }}
               {{- end }}
-            {{- end }}
-          </dl>
-        </details>
+              {{- with .RelatedPackages }}
+                <dt>Related Packages</dt>
+                <dd>{{ . }}</dd>
+              {{- end }}
+              {{- with .Declarations }}
+                <dt>Declared</dt>
+                {{- range . }}
+                  <dd>
+                    <a href="{{ .URL }}">{{ .Name }}</a>
+                  </dd>
+                {{- end }}
+              {{- end }}
+            </dl>
+          </details>
+        {{- end }}
       {{- end }}
       <footer>
         <nav id="pagination">