git: 0854172b37 - main - Fix download link for non-English languages
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 02 Nov 2022 15:49:49 UTC
The branch main has been updated by carlavilla: URL: https://cgit.FreeBSD.org/doc/commit/?id=0854172b37a3a82e45b25c5496055544fba7d461 commit 0854172b37a3a82e45b25c5496055544fba7d461 Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2022-11-02 15:48:35 +0000 Commit: Sergio Carlavilla Delgado <carlavilla@FreeBSD.org> 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>