From a1dfc548198a1326e71f1dd70303a5d3441f7a39 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