- {{ $registryBase := "https://scverse.org/ecosystem-packages/" }} - {{ $data := resources.GetRemote (printf "%spackages.json" $registryBase) }} - {{ $pkgs := transform.Unmarshal $data.Content }} + {{ $registry := partialCached "registry.html" "registry" }} + {{ $registryBase := $registry.base }} + {{ $pkgs := $registry.pkgs }} - {{/* ponytail: registry has no order key, so core packages are alphabetical; re-curate once one exists. */}} - {{ $core := slice }} - {{ range where $pkgs "category" "in" (slice "core-datastructure" "core-framework") }} - {{ $core = $core | append (merge . (dict "sortkey" (lower .name))) }} - {{ end }} - {{ $core = sort $core "sortkey" }} - - {{ with $core }} + {{ with $registry.core }}

Packages maintained by core team

{{ $sections.core_packages | markdownify }} {{ with where . "category" "core-datastructure" }} @@ -54,8 +47,7 @@

Ecosystem packages maintained by scverse community

{{ range $pkgs }} {{ $tags := .tags | default slice }} {{ $category := .primary_category | default "" }} - {{/* core-infrastructure is the scverse repos themselves, not packages, so it does not count here. */}} - {{ $core := in (slice "core-framework" "core-datastructure") (.category | default "") }} + {{ $isCore := in $registry.coreCategories (.category | default "") }} {{ if and $category (not (in $categories $category)) }} {{ $categories = $categories | append $category }} {{ end }} @@ -63,8 +55,7 @@

Ecosystem packages maintained by scverse community

{{ $desc := trim (.description | markdownify | plainify | htmlUnescape | replaceRE `\s+` " ") " " }} {{ $search := lower (printf "%s %s %s %s %s" .name $desc (delimit $tags " ") $category .language) }} {{ $items = $items | append (merge . (dict - "sortkey" (printf "%s %s" (cond $core "0" "1") (lower .name)) - "core" $core + "core" $isCore "normtags" $tags "category" $category "language" .language @@ -73,7 +64,6 @@

Ecosystem packages maintained by scverse community

)) }} {{ end }} - {{ $items = sort $items "sortkey" }} {{/* Chip row: every category in the schema that is actually in use, biggest first. */}} {{ $categoryCounts := slice }} diff --git a/layouts/partials/main/packages.html b/layouts/partials/main/packages.html index af633c93..fc1794fb 100644 --- a/layouts/partials/main/packages.html +++ b/layouts/partials/main/packages.html @@ -1,43 +1,35 @@
Core packages
- {{ $registryBase := "https://scverse.org/ecosystem-packages/" }} - {{ $data := resources.GetRemote (printf "%spackages.json" $registryBase) }} - {{ with $data }} - {{/* ponytail: registry has no order key, so core packages are alphabetical; re-curate once one exists. */}} - {{ $core := slice }} - {{ range where (transform.Unmarshal .Content) "category" "in" (slice "core-datastructure" "core-framework") }} - {{ $core = $core | append (merge . (dict "sortkey" (lower .name))) }} - {{ end }} - {{ with sort $core "sortkey" }} -