From fc5fd2edd9b8282497e33a18300eab694d8a89c6 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 21 Jun 2024 13:02:08 +0200 Subject: refactor: switch to templ for HTML templates --- internal/components/options.templ | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 internal/components/options.templ (limited to 'internal/components/options.templ') diff --git a/internal/components/options.templ b/internal/components/options.templ new file mode 100644 index 0000000..726d328 --- /dev/null +++ b/internal/components/options.templ @@ -0,0 +1,34 @@ +package components + +import ( + "searchix/internal/index" + "searchix/internal/nix" +) + +templ Options(result *index.Result) { + + + + + + + + + for _, hit := range result.Hits { + @optionRow(hit.Data.(nix.Option)) + } + +
TitleDescription
+} + +templ optionRow(o nix.Option) { + + + @openDialogLink(o.Name) + + + @markdown(firstSentence(o.Description)) + + + +} -- cgit 1.4.1