git: 0854172b37 - main - Fix download link for non-English languages

Sergio Carlavilla Delgado <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.doc
Message-ID <[email protected]>
The branch main has been updated by carlavilla:

URL: https://cgit.FreeBSD.org/doc/commit/?id=0854172b37a3a82e45b25c5496055544fba7d461

commit 0854172b37a3a82e45b25c5496055544fba7d461
Author:     Zhenlei Huang <[email protected]>
AuthorDate: 2022-11-02 15:48:35 +0000
Commit:     Sergio Carlavilla Delgado <[email protected]>
CommitDate: 2022-11-02 15:48:35 +0000

    Fix download link for non-English languages
    
    Approved by:            carlavilla@
    Differential Revision:  https://reviews.freebsd.org/D37144
---
 documentation/themes/beastie/layouts/index.html | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/documentation/themes/beastie/layouts/index.html b/documentation/themes/beastie/layouts/index.html
index 6ee1b26a3b..15881d7d08 100644
--- a/documentation/themes/beastie/layouts/index.html
+++ b/documentation/themes/beastie/layouts/index.html
@@ -1,9 +1,11 @@
 {{ define "main" }}
-  {{ $language := "" }}
-  {{ $currentLang := $.Site.Language.Lang }}
+  {{ $downloadurl := "" }}
+  {{ $language := $.Site.Language.Lang }}
 
-  {{ if ne $currentLang "en" }}
-    {{ $language = $currentLang }}
+  {{ if ne $language "en" }}
+    {{ $downloadurl = printf "%s/%s/%s/" $.Site.Params.websiteURL $language "where" }}
+  {{ else }}
+    {{ $downloadurl = printf "%s/%s/" $.Site.Params.websiteURL "where" }}
   {{ end }}
   <main class="main-wrapper">
     {{ partial "global-search.html" . }}
@@ -15,7 +17,7 @@
         </a>
       </div>
       <div class="card">
-        <a href={{ printf "%s%s/%s" $.Site.Params.websiteURL $language "where" }}>
+        <a href={{ $downloadurl }}>
           <h5>{{ i18n "download" }}</h5>
           <p>{{ i18n "download-freebsd" }}</p>
         </a>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.