1
0
Fork 0
mirror of https://github.com/eosswedenorg/apt synced 2026-06-16 04:34:56 +02:00

Update search module to handle new package format.

This commit is contained in:
Henrik Hautakoski 2022-09-06 13:00:40 +02:00
parent bb91640bab
commit 088f1106a5
2 changed files with 5 additions and 5 deletions

View file

@ -20,7 +20,7 @@
</span> </span>
<span class="search-results-archive"> <span class="search-results-archive">
[<span x-text="item.archive"></span>:<span x-text="item.component"></span>] [<span x-text="item.repo"></span>:<span x-text="item.component"></span>]
</span> </span>
</div> </div>
<span class="search-results-description" x-text="item.description"></span> <span class="search-results-description" x-text="item.description"></span>

View file

@ -4,13 +4,13 @@
var package_data = [ var package_data = [
{%- assign repos = site.repos -%} {%- assign repos = site.repos -%}
{%- for repo in repos -%} {%- for repo in repos -%}
{%- assign packages = site.packages | where: 'Repo', repo.slug -%} {%- assign packages = site.packages | where: 'repo', repo.slug -%}
{%- for pkg in packages -%} {%- for pkg in packages -%}
{"id":{{ id }},"url":{{ pkg.url | relative_url | jsonify }},"name":{{ pkg.Name | jsonify }},"repo":{{ pkg.Repo | jsonify }},"archive":{{ pkg.Archive | jsonify }},"component":{{ pkg.Component | jsonify }},"description": {{ pkg.Description | jsonify }}, {"id":{{ id }},"url":{{ pkg.url | relative_url | jsonify }},"name":{{ pkg.name | jsonify }},"repo":{{ pkg.repo | jsonify }},"distribution":{{ pkg.distribution | jsonify }},"component":{{ pkg.component | jsonify }},"description": {{ pkg.description | jsonify }},
{%- assign ver = "-" -%} {%- assign ver = "-" -%}
{%- assign first_ver = pkg.Versions | limit: 1 -%} {%- assign first_ver = pkg.versions | limit: 1 -%}
{%- for v in first_ver -%} {%- for v in first_ver -%}
{%- assign ver = v[0] -%} {%- assign ver = v.version -%}
{%- endfor -%} {%- endfor -%}
"version":{{ ver | jsonify }} "version":{{ ver | jsonify }}
{%- assign id = id | plus: 1 -%} {%- assign id = id | plus: 1 -%}