From 05e61978906a08132c4340a5f9ae518134dd0fa9 Mon Sep 17 00:00:00 2001
From: Alan Pearce
Date: Fri, 17 May 2024 14:06:06 +0200
Subject: feat: support searching packages
---
frontend/templates/blocks/packages.gotmpl | 26 ++++++++++++++++++++++++++
frontend/templates/index.gotmpl | 6 +++---
frontend/templates/opensearch.xml.gotmpl | 10 +++++-----
3 files changed, 34 insertions(+), 8 deletions(-)
create mode 100644 frontend/templates/blocks/packages.gotmpl
(limited to 'frontend/templates')
diff --git a/frontend/templates/blocks/packages.gotmpl b/frontend/templates/blocks/packages.gotmpl
new file mode 100644
index 0000000..68f9246
--- /dev/null
+++ b/frontend/templates/blocks/packages.gotmpl
@@ -0,0 +1,26 @@
+{{- define "hits" }}
+ {{- range . }}
+ {{- with .Data }}
+
+
+
+ {{ .Name }}
+
+
+ {{ .Description }}
+
+ {{- with .Version }}
+ - Version
+ - {{ . }}
+ {{- end }}
+ {{- with .Definition }}
+ - Defined
+ -
+ Source
+
+ {{- end }}
+
+
+ {{- end }}
+ {{- end }}
+{{- end }}
diff --git a/frontend/templates/index.gotmpl b/frontend/templates/index.gotmpl
index 90f875b..0211a5b 100644
--- a/frontend/templates/index.gotmpl
+++ b/frontend/templates/index.gotmpl
@@ -13,8 +13,8 @@
{{- end }}
@@ -25,7 +25,7 @@
{{- range $key, $value := .Sources }}
{{- $value.Name -}}
diff --git a/frontend/templates/opensearch.xml.gotmpl b/frontend/templates/opensearch.xml.gotmpl
index 8d978ea..c761fd4 100644
--- a/frontend/templates/opensearch.xml.gotmpl
+++ b/frontend/templates/opensearch.xml.gotmpl
@@ -2,15 +2,15 @@
xmlns="http://a9.com/-/spec/opensearch/1.1/"
xmlns:moz="http://www.mozilla.org/2006/browser/search/"
>
- Searchix {{ .Source.Name }}
- Search {{ .Source.Name }} options with Searchix
- Search options {{ .Source.Name }}
+ Searchix {{ sourceNameAndType .Source }}
+ Search {{ sourceNameAndType .Source }} with Searchix
+ Search {{ sourceNameAndType .Source }}
{{ .BaseURL }}/options/{{ .Source.Key }}/search{{ .BaseURL }}/{{ .Source.ImporterType }}/{{ .Source.Key }}/search
--
cgit 1.4.1