From 36afb1c4ce57fca8ba054e43cfdf8467af43dece Mon Sep 17 00:00:00 2001 From: svrnm Date: Wed, 7 Aug 2024 17:32:05 +0200 Subject: [PATCH] make native and first party searchable in registry Signed-off-by: svrnm --- assets/js/registrySearch.js | 1 + layouts/ecosystem/registry.json.json | 12 +++++++++++- .../shortcodes/ecosystem/registry/search-form.html | 2 +- static/refcache.json | 4 ++++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/assets/js/registrySearch.js b/assets/js/registrySearch.js index f1ed9b404826..d91c590585a3 100644 --- a/assets/js/registrySearch.js +++ b/assets/js/registrySearch.js @@ -5,6 +5,7 @@ const miniSearchOptions = { '_key', 'tags', 'package.name', + 'flags', 'license', 'language', 'registryType', diff --git a/layouts/ecosystem/registry.json.json b/layouts/ecosystem/registry.json.json index f2b1ea932533..2e8ab1a4aaee 100644 --- a/layouts/ecosystem/registry.json.json +++ b/layouts/ecosystem/registry.json.json @@ -1,7 +1,17 @@ {{ $counter := 0 -}} {{ $entries := slice -}} {{ range $key, $entry := .Site.Data.registry -}} - {{ $entry = merge $entry (dict "_key" $key "id" $counter) -}} + {{ $flags := slice -}} + {{ if .isNative -}} + {{ $flags = $flags | append "native" -}} + {{ end -}} + {{ if .isFirstParty -}} + {{ $flags = $flags | append "first party" -}} + {{ end -}} + {{ if .deprecated -}} + {{ $flags = $flags | append "deprecated" -}} + {{ end -}} + {{ $entry = merge $entry (dict "_key" $key "id" $counter "flags" $flags) -}} {{ $entries = $entries | append $entry -}} {{ $counter = add $counter 1 }} {{ end -}} diff --git a/layouts/shortcodes/ecosystem/registry/search-form.html b/layouts/shortcodes/ecosystem/registry/search-form.html index f751e7c24753..4e2fc00028c1 100644 --- a/layouts/shortcodes/ecosystem/registry/search-form.html +++ b/layouts/shortcodes/ecosystem/registry/search-form.html @@ -106,5 +106,5 @@ - + {{ partial "script.html" (dict "src" "js/registrySearch.js") -}} diff --git a/static/refcache.json b/static/refcache.json index a38a50101d99..60717ec67c09 100644 --- a/static/refcache.json +++ b/static/refcache.json @@ -303,6 +303,10 @@ "StatusCode": 206, "LastSeen": "2024-01-08T12:17:27.412252+01:00" }, + "https://cdn.jsdelivr.net/npm/minisearch@7.1.0/dist/umd/index.min.js": { + "StatusCode": 206, + "LastSeen": "2024-08-07T17:27:34.715582+02:00" + }, "https://cerbos.dev/": { "StatusCode": 206, "LastSeen": "2024-01-30T15:24:42.717338-05:00"