diff options
Diffstat (limited to 'frontend/templates')
-rw-r--r-- | frontend/templates/blocks/packages.gotmpl | 26 | ||||
-rw-r--r-- | frontend/templates/index.gotmpl | 6 | ||||
-rw-r--r-- | frontend/templates/opensearch.xml.gotmpl | 10 |
3 files changed, 34 insertions, 8 deletions
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 }} + <details id="{{ .Name }}"> + <summary> + <h3> + {{ .Name }} + </h3> + </summary> + {{ .Description }} + <dl> + {{- with .Version }} + <dt>Version</dt> + <dd>{{ . }}</dd> + {{- end }} + {{- with .Definition }} + <dt>Defined</dt> + <dd> + <a href="{{ . }}">Source</a> + </dd> + {{- end }} + </dl> + </details> + {{- 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 @@ <link rel="search" type="application/opensearchdescription+xml" - title="Searchix {{ $value.Name }}" - href="/options/{{ $key }}/opensearch.xml" + title="Searchix {{ sourceNameAndType $value }}" + href="/{{ .Importer }}/{{ $key }}/opensearch.xml" /> {{- end }} </head> @@ -25,7 +25,7 @@ {{- range $key, $value := .Sources }} <a {{ if eq $.Source.Name $value.Name }}class="current"{{ end }} - href="/options/{{ $key }}/search{{ and $.Query (printf "?query=%s" $.Query) }}" + href="/{{ .Importer }}/{{ $key }}/search{{ and $.Query (printf "?query=%s" $.Query) }}" > {{- $value.Name -}} </a> 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/" > - <ShortName>Searchix {{ .Source.Name }}</ShortName> - <LongName>Search {{ .Source.Name }} options with Searchix</LongName> - <Description>Search options {{ .Source.Name }}</Description> + <ShortName>Searchix {{ sourceNameAndType .Source }}</ShortName> + <LongName>Search {{ sourceNameAndType .Source }} with Searchix</LongName> + <Description>Search {{ sourceNameAndType .Source }}</Description> <Url type="text/html" method="get" - template="{{ .BaseURL }}/options/{{ .Source.Key }}/search?query={searchTerms}&from=opensearch" + template="{{ .BaseURL }}/{{ .Source.ImporterType }}/{{ .Source.Key }}/search?query={searchTerms}&from=opensearch" /> <moz:SearchForm - >{{ .BaseURL }}/options/{{ .Source.Key }}/search</moz:SearchForm + >{{ .BaseURL }}/{{ .Source.ImporterType }}/{{ .Source.Key }}/search</moz:SearchForm > </OpenSearchDescription> |