Skip to content

Commit

Permalink
make native and first party searchable in registry (#4992)
Browse files Browse the repository at this point in the history
Signed-off-by: svrnm <[email protected]>
  • Loading branch information
svrnm authored Aug 8, 2024
1 parent 1e1c788 commit 844291f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions assets/js/registrySearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const miniSearchOptions = {
'_key',
'tags',
'package.name',
'flags',
'license',
'language',
'registryType',
Expand Down
12 changes: 11 additions & 1 deletion layouts/ecosystem/registry.json.json
Original file line number Diff line number Diff line change
@@ -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 -}}
Expand Down
2 changes: 1 addition & 1 deletion layouts/shortcodes/ecosystem/registry/search-form.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,5 @@
</ul>
</div>

<script src="https://cdn.jsdelivr.net/npm/minisearch@6.3.0/dist/umd/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/minisearch@7.1.0/dist/umd/index.min.js" integrity="sha384-58p1D2xuw/76VRFUgDMRcrtnJAW5LWLE02ihn8aITu65c4vgo+BLy7raRKNC7KaL" crossorigin="anonymous"></script>
{{ partial "script.html" (dict "src" "js/registrySearch.js") -}}
4 changes: 4 additions & 0 deletions static/refcache.json
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,10 @@
"StatusCode": 206,
"LastSeen": "2024-01-08T12:17:27.412252+01:00"
},
"https://cdn.jsdelivr.net/npm/[email protected]/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"
Expand Down

0 comments on commit 844291f

Please sign in to comment.