Now using two separate files for translated app data information, and normal metadata.

This commit is contained in:
Adsooi 2021-08-11 15:07:15 +02:00
parent a02e94cfbd
commit 8d996d8734
Signed by: Ad5001
GPG key ID: EF45F9C6AFE20160
2 changed files with 25 additions and 24 deletions

View file

@ -1,8 +1,9 @@
<!DOCTYPE html>
{{ $lang := .Site.Language.Lang }}
{{ $appindex := .Params.SectionHeader.AppIndex }}
{{ $data := index .Site.Data $lang }}
{{ $appdata := index $data.apps $appindex }}
{{ $i18nData := index .Site.Data $lang }}
{{ $i18nAppData := index $i18nData.apps $appindex }}
{{ $AppData := index .Site.Data.metadata $appindex }}
{{ $disclaimers := newScratch }}
{{ $disclaimers.Set "snapcraft" false }}
{{ $disclaimers.Set "firefox" false }}
@ -55,35 +56,35 @@
<div class="grid">
<p class="inline column col2">
<i class="icon-universal icon-as-text" alt=""></i>
{{ i18n "supportedPlatforms" }}&nbsp;{{ partial "platforms.html" $appdata.platforms }}
{{ i18n "supportedPlatforms" }}&nbsp;{{ partial "platforms.html" $AppData.platforms }}
</p>
<p class="inline column col2">
<i class="icon-lang icon-as-text" alt=""></i>
{{ i18n "translated" }}&nbsp;{{ partial "translations.html" $appdata.translated }}
{{ i18n "translated" }}&nbsp;{{ partial "translations.html" $AppData.translated }}
</p>
<p class="inline column col2">
<i class="icon-git icon-as-text" alt=""></i>
{{ i18n "latestVersion" }}v{{ $appdata.version }}
{{ i18n "latestVersion" }}v{{ $AppData.version }}
</p>
<p class="inline column col2">
<i class="icon-git icon-as-text" alt=""></i>
{{ i18n "status" }}{{ $appdata.status }}
{{ i18n "status" }}{{ $i18nAppData.status }}
</p>
<p class="inline column col2">
<i class="icon-code icon-as-text" alt=""></i>
{{ i18n "programingLanguages" }}{{ delimit $appdata.languages ", " }}
{{ i18n "programingLanguages" }}{{ delimit $AppData.languages ", " }}
</p>
<p class="inline column col2">
<i class="icon-frameworks icon-as-text" alt=""></i>
{{ i18n "frameworks" }}&nbsp;{{ delimit $appdata.frameworks ", " | markdownify }}
{{ i18n "frameworks" }}&nbsp;{{ delimit $i18nAppData.frameworks ", " | markdownify }}
</p>
{{ if $appdata.touchfriendly }}
{{ if $AppData.touchfriendly }}
<p class="inline column col2">
<i class="icon-touch icon-as-text" alt=""></i>
{{ i18n "touchFriendly" }}
</p>
{{ end }}
{{ if $appdata.keyboardoriented }}
{{ if $AppData.keyboardoriented }}
<p class="inline column col2">
<i class="icon-keyboard icon-as-text" alt=""></i>
{{ i18n "keyboardOriented" }}
@ -91,7 +92,7 @@
{{ end }}
<p class="inline column col2">
<i class="icon-license icon-as-text" alt=""></i>
{{ i18n "license" }}&nbsp;{{ $appdata.license | markdownify }}
{{ i18n "license" }}&nbsp;{{ $AppData.license | markdownify }}
</p>
</div>
<div class="grid flex-center">&nbsp;
@ -103,7 +104,7 @@
<section id="download-section" class="center content-center padding-container text-center">
<hr>
<h1 class="flex flex-center"><i class="icon-download icon-larger-text" alt=""></i>{{ i18n "download" }}</h1>
{{ i18n "downloadApp" (dict "Name" .Name "Platforms" (delimit $appdata.platforms ", ")) }}
{{ i18n "downloadApp" (dict "Name" .Name "Platforms" (delimit $AppData.platforms ", ")) }}
<br><br>
<!-- download table -->
<div class="center columns-container">
@ -136,10 +137,10 @@
</a>
<br><br>{{ i18n "warnExternalWebsite" "addons.mozilla.org" }}
{{ else }}
{{ i18n "file" }} {{ replace .Name "<version>" $appdata.version }}<br><br>
{{ i18n "file" }} {{ replace .Name "<version>" $AppData.version }}<br><br>
<div class="primary center fit-content" role="button">
{{ $filename := replace .File "<version>" $appdata.version }}
<a href="https://artifacts.accountfree.org/repository/apps.ad5001.eu-apps/{{ $appindex }}/v{{ $appdata.version }}/{{ $filename }}" download rel="noreferrer">
{{ $filename := replace .File "<version>" $AppData.version }}
<a href="https://artifacts.accountfree.org/repository/apps.ad5001.eu-apps/{{ $appindex }}/v{{ $AppData.version }}/{{ $filename }}" download rel="noreferrer">
<i class="icon-download icon-as-text" alt=""></i>{{ i18n "download" }}
</a>
</div>

View file

@ -4,26 +4,27 @@
{{ $site := .Site }}
{{ range .Site.Data.list }}
{{ $index := . }}
{{ $data := index $site.Data $site.Language.Lang }}
{{ with index $data.apps $index }}
{{ $i18nData := index $site.Data $site.Language.Lang }}
{{ $i18nAppData := index $i18nData.apps $index }}
{{ $AppData := index $site.Data.metadata $index }}
<div class="padding-container">
<div class="block-preview" style="background-image: url(/img/preview/{{ $index }}.webp);">
<a href="{{ $index }}/" class="label-link" alt="{{ .name }}">
<a href="{{ $index }}/" class="label-link" alt="{{ $i18nAppData.name }}">
<div class="label">
<h2>
<span class="flex app-name" style="float: left">
&nbsp;<img src="/icons/apps/{{ $index }}.svg" loading="lazy" class="icon-larger-text" alt=""/> {{ .name }}
&nbsp;<img src="/icons/apps/{{ $index }}.svg" loading="lazy" class="icon-larger-text" alt=""/> {{ $i18nAppData.name }}
</span>
<span class="right-icon"><i class="icon-lookup icon-as-text" alt="{{ i18n "learnMore" }}"/></i></span> <!-- Hint that you can click -->
&nbsp;
</h2>
<p class="show-on-hover">{{ .description }}</p>
<p class="show-on-hover">{{ i18n "status" }} {{ .status }}</p>
<p class="show-on-hover">{{ $i18nAppData.description }}</p>
<p class="show-on-hover">{{ i18n "status" }} {{ $i18nAppData.status }}</p>
<p class="flex show-on-hover">{{ i18n "worksOn" }}&nbsp;
{{ partial "platforms.html" .platforms }}
{{ partial "platforms.html" $AppData.platforms }}
</p>
<p class="flex show-on-hover">{{ i18n "translated" }}&nbsp;
{{ partial "translations.html" .translated }}
{{ partial "translations.html" $AppData.translated }}
</p>
<p class="primary" role="button"><i class="icon-lookup icon-as-text" alt="{{ i18n "learnMore" }}"></i>{{ i18n "learnMore" }}</p>
</div>
@ -31,7 +32,6 @@
</div>
</div>
{{ end }}
{{ end }}
</div>
{{ end }}