diff options
| -rw-r--r-- | i18n/en.yaml | 4 | ||||
| -rw-r--r-- | i18n/it.yaml | 4 | ||||
| -rw-r--r-- | layouts/_default/baseof.html | 4 | ||||
| -rw-r--r-- | layouts/shortcodes/pkg-list.html | 28 |
4 files changed, 26 insertions, 14 deletions
diff --git a/i18n/en.yaml b/i18n/en.yaml index 9bf3574..1fd5894 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -195,5 +195,9 @@ pkg_list_loading: "Loading packages..." pkg_list_error: "Could not load packages. Visit the repository directly." pkg_list_filter: "Filter packages..." pkg_list_link_label: "View" +pkg_list_no_results: "No packages match your filter." +pkg_list_col_package: "Package" +pkg_list_col_version: "Version" +pkg_list_col_link: "Link" pkg_changelog_loading: "Loading changelog..." pkg_changelog_error: "Could not load changelog. Visit the repository directly." diff --git a/i18n/it.yaml b/i18n/it.yaml index ba04bce..1bc7ef7 100644 --- a/i18n/it.yaml +++ b/i18n/it.yaml @@ -197,5 +197,9 @@ pkg_list_loading: "Caricamento pacchetti..." pkg_list_error: "Impossibile caricare i pacchetti. Visita il repository direttamente." pkg_list_filter: "Filtra pacchetti..." pkg_list_link_label: "Visualizza" +pkg_list_no_results: "Nessun pacchetto corrisponde al filtro." +pkg_list_col_package: "Pacchetto" +pkg_list_col_version: "Versione" +pkg_list_col_link: "Link" pkg_changelog_loading: "Caricamento changelog..." pkg_changelog_error: "Impossibile caricare il changelog. Visita il repository direttamente." diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 50bdf39..734c808 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -93,9 +93,9 @@ <!-- Package repository shortcodes --> {{ $pkgListScript := resources.Get "js/pkg-list.js" | minify }} - <script src="{{ $pkgListScript.RelPermalink }}"></script> + <script src="{{ $pkgListScript.RelPermalink }}" defer></script> {{ $pkgChangelogScript := resources.Get "js/pkg-changelog.js" | minify }} - <script src="{{ $pkgChangelogScript.RelPermalink }}"></script> + <script src="{{ $pkgChangelogScript.RelPermalink }}" defer></script> <!-- 404 Not Found page script --> {{ $notFoundScript := resources.Get "js/not-found-page.js" | minify }} diff --git a/layouts/shortcodes/pkg-list.html b/layouts/shortcodes/pkg-list.html index df382dd..b1c2cdf 100644 --- a/layouts/shortcodes/pkg-list.html +++ b/layouts/shortcodes/pkg-list.html @@ -1,10 +1,14 @@ -{{- $loading := i18n "pkg_list_loading" | default "Loading packages..." -}} -{{- $error := i18n "pkg_list_error" | default "Could not load packages." -}} -{{- $filter := i18n "pkg_list_filter" | default "Filter packages..." -}} -{{- $view := i18n "pkg_list_link_label" | default "View" -}} +{{- $loading := i18n "pkg_list_loading" | default "Loading packages..." -}} +{{- $error := i18n "pkg_list_error" | default "Could not load packages." -}} +{{- $filter := i18n "pkg_list_filter" | default "Filter packages..." -}} +{{- $view := i18n "pkg_list_link_label" | default "View" -}} +{{- $noResults := i18n "pkg_list_no_results" | default "No packages match your filter." -}} +{{- $colPkg := i18n "pkg_list_col_package" | default "Package" -}} +{{- $colVer := i18n "pkg_list_col_version" | default "Version" -}} +{{- $colLink := i18n "pkg_list_col_link" | default "Link" -}} <div - x-data="pkgList({ loading: {{ $loading | jsonify }}, error: {{ $error | jsonify }}, filter: {{ $filter | jsonify }}, view: {{ $view | jsonify }} })" + x-data="pkgList({ loading: {{ $loading | jsonify }}, error: {{ $error | jsonify }}, filter: {{ $filter | jsonify }}, view: {{ $view | jsonify }}, noResults: {{ $noResults | jsonify }}, colPkg: {{ $colPkg | jsonify }}, colVer: {{ $colVer | jsonify }}, colLink: {{ $colLink | jsonify }} })" x-init="init()" class="not-prose my-6" > @@ -28,16 +32,16 @@ x-model="filter" :placeholder="i18n.filter" class="w-full sm:w-72 px-3 py-2 text-sm bg-bg border border-border/50 rounded-lg text-text placeholder-text-dim focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition-colors" - aria-label="Filter packages" + :aria-label="i18n.filter" /> </div> <div class="overflow-x-auto rounded-lg border border-border/50"> <table class="w-full text-sm text-left"> <thead class="bg-surface text-text-dim uppercase text-xs tracking-wide"> <tr> - <th class="px-4 py-3">Package</th> - <th class="px-4 py-3">Version</th> - <th class="px-4 py-3 text-right">Link</th> + <th class="px-4 py-3" x-text="i18n.colPkg"></th> + <th class="px-4 py-3" x-text="i18n.colVer"></th> + <th class="px-4 py-3 text-right" x-text="i18n.colLink"></th> </tr> </thead> <tbody class="divide-y divide-border/30"> @@ -51,16 +55,16 @@ target="_blank" rel="noopener" class="inline-flex items-center gap-1 text-accent hover:underline text-xs" - :aria-label="'View ' + pkg.name + ' in repository'" + :aria-label="i18n.view + ' ' + pkg.name" > <span x-text="pkg.label"></span> - <i data-feather="external-link" class="w-3 h-3" aria-hidden="true"></i> + <svg xmlns="http://www.w3.org/2000/svg" class="w-3 h-3" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg> </a> </td> </tr> </template> <tr x-show="filtered.length === 0"> - <td colspan="3" class="px-4 py-4 text-center text-text-dim text-sm">No packages match your filter.</td> + <td colspan="3" class="px-4 py-4 text-center text-text-dim text-sm" x-text="i18n.noResults"></td> </tr> </tbody> </table> |
