git: da935c7b3a - main - Disable to use Japanese translated press entry. Because the Japanese translation of the press entry is too old to use.

Ryusuke SUZUKI <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.doc
Message-ID <[email protected]>
The branch main has been updated by ryusuke:

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

commit da935c7b3a4f22f8460ca529a4101d79f70fd1dc
Author:     Ryusuke SUZUKI <[email protected]>
AuthorDate: 2021-02-21 12:08:41 +0000
Commit:     Ryusuke SUZUKI <[email protected]>
CommitDate: 2021-02-21 12:08:41 +0000

    Disable to use Japanese translated press entry.
    Because the Japanese translation of the press entry is too old to use.
---
 website/themes/beastie/layouts/partials/press.html | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/website/themes/beastie/layouts/partials/press.html b/website/themes/beastie/layouts/partials/press.html
index 803072a1ba..ca0e3c1d16 100644
--- a/website/themes/beastie/layouts/partials/press.html
+++ b/website/themes/beastie/layouts/partials/press.html
@@ -1,7 +1,12 @@
 {{ $pressPath := (printf "data/%s/press/press.toml" $.Language.Lang) }}
 
+{{ $translatedPressEnabled := false }}
+{{ if and (fileExists $pressPath) (ne $.Language.Lang "ja") }}
+  {{ $translatedPressEnabled = true }}
+{{ end }}
+
 {{ $pressData := "" }}
-{{ if (fileExists $pressPath) -}}
+{{ if $translatedPressEnabled -}}
   {{ $data := index .Site.Data $.Language.Lang }}
   {{ $pressData = $data.press }}
 {{ else }}
@@ -16,7 +21,7 @@
     <p>
       <span class="txtdate">{{ dateFormat "2006-01" .date }}</span>
       <br />
-      <a href="{{.Site.BaseURL | relLangURL }}press/#{{ dateFormat "2006-01" .date }}:{{ $pressCounter }}">{{ .name }}</a>
+      <a href="{{ if $translatedPressEnabled }}{{ .Site.BaseURL | relLangURL }}{{ else }}{{ $.Site.BaseURL }}{{ end }}press/#{{ dateFormat "2006-01" .date }}:{{ $pressCounter }}">{{ .name }}</a>
     </p>
     {{ end }}
     {{ $pressCounter = add $pressCounter 1 }}
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-doc-all
To unsubscribe, send any mail to "[email protected]"
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.