about summary refs log tree commit diff stats
path: root/internal/components/packageDetail.templ
diff options
context:
space:
mode:
authorAlan Pearce2025-01-15 22:25:33 +0100
committerAlan Pearce2025-01-15 22:25:33 +0100
commit7aea6aa210a8939ac208fb7540d1b46ba69a995f (patch)
tree80f8db2539289ca545eb356bf87e2b764d39c966 /internal/components/packageDetail.templ
parentb26ddba432f8bde78022d2fc8837f0ffb25448b1 (diff)
downloadsearchix-7aea6aa210a8939ac208fb7540d1b46ba69a995f.tar.lz
searchix-7aea6aa210a8939ac208fb7540d1b46ba69a995f.tar.zst
searchix-7aea6aa210a8939ac208fb7540d1b46ba69a995f.zip
feat: enable searching via program names for multi-program packages
implements: https://todo.sr.ht/~alanpearce/searchix/6
Diffstat (limited to 'internal/components/packageDetail.templ')
-rw-r--r--internal/components/packageDetail.templ16
1 files changed, 13 insertions, 3 deletions
diff --git a/internal/components/packageDetail.templ b/internal/components/packageDetail.templ
index 65c74aa..84d2bdf 100644
--- a/internal/components/packageDetail.templ
+++ b/internal/components/packageDetail.templ
@@ -1,8 +1,6 @@
 package components
 
-import (
-	"go.alanpearce.eu/searchix/internal/nix"
-)
+import "go.alanpearce.eu/searchix/internal/nix"
 
 func licenseName(l nix.License) string {
 	if l.FullName != "" {
@@ -32,6 +30,18 @@ templ PackageDetail(pkg nix.Package) {
 				<code>{ pkg.MainProgram }</code>
 			</dd>
 		}
+		if len(pkg.Programs) > 0 {
+			<dt>Programs</dt>
+			<dd>
+				<ul>
+					for _, p := range pkg.Programs {
+						<li>
+							<code>{ p }</code>
+						</li>
+					}
+				</ul>
+			</dd>
+		}
 		if len(pkg.Homepages) > 0 {
 			<dt>Homepage</dt>
 			<dd>