diff options
author | Alan Pearce | 2024-05-07 18:54:45 +0200 |
---|---|---|
committer | Alan Pearce | 2024-05-07 18:54:45 +0200 |
commit | 771ef706d7c70f583dad956077eaf79fc4fdc093 (patch) | |
tree | e5940f27bcec96607dfd024b00dc2d34ee9df19e /frontend/templates/blocks/options.gotmpl | |
parent | c15b142b18dcdc7f5ab6d5f1afca8ae1696692cc (diff) | |
download | searchix-771ef706d7c70f583dad956077eaf79fc4fdc093.tar.lz searchix-771ef706d7c70f583dad956077eaf79fc4fdc093.tar.zst searchix-771ef706d7c70f583dad956077eaf79fc4fdc093.zip |
style: split homepage and search page
Diffstat (limited to 'frontend/templates/blocks/options.gotmpl')
-rw-r--r-- | frontend/templates/blocks/options.gotmpl | 112 |
1 files changed, 57 insertions, 55 deletions
diff --git a/frontend/templates/blocks/options.gotmpl b/frontend/templates/blocks/options.gotmpl index 2f9d88a..e39d60c 100644 --- a/frontend/templates/blocks/options.gotmpl +++ b/frontend/templates/blocks/options.gotmpl @@ -1,59 +1,61 @@ -{{ template "results" . }} -{{ define "results" }} - {{- with .Results }} - {{- range .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> +{{- template "results" .Results -}} +{{- define "results" }} + <div id="results"> + {{- with . }} + {{- range .Results }} + <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> - {{- else }} - Nothing found + {{- 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> + {{- else }} + Nothing found + {{- end }} {{- end }} - {{- end }} -{{ end }} + </div> +{{- end }} |