From 06b1f5d4b9552aec9a2451bdb2fe49c17273153f Mon Sep 17 00:00:00 2001 From: zzossig Date: Wed, 19 Feb 2020 21:09:41 +0900 Subject: [PATCH] Hide top posts when no orders, i18n posts-by-order #184 fixes https://github.com/zzossig/hugo-theme-zzo/issues/184#issuecomment-588179493 --- i18n/en.toml | 5 +++- i18n/fa.toml | 3 ++ i18n/ko.toml | 5 +++- i18n/zh.toml | 5 +++- .../partials/sidebar/list/posts-by-order.html | 29 ++++++++++++------- 5 files changed, 34 insertions(+), 13 deletions(-) diff --git a/i18n/en.toml b/i18n/en.toml index 670ff48..872e777 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -95,4 +95,7 @@ other = "Overview" other = "Pinned" [nojs-message] -other = "Please enable Javascript to view the contents" \ No newline at end of file +other = "Please enable Javascript to view the contents" + +[posts-by-order] +other = "TOP POSTS" \ No newline at end of file diff --git a/i18n/fa.toml b/i18n/fa.toml index 5396637..294f6ba 100644 --- a/i18n/fa.toml +++ b/i18n/fa.toml @@ -96,3 +96,6 @@ other = "پین شده" [nojs-message] other = "لطفا برای نمایش محتوا اجرای جاوا اسکریپت را فعال کنید" + +[posts-by-order] +other = "TOP POSTS" \ No newline at end of file diff --git a/i18n/ko.toml b/i18n/ko.toml index c9a0bf0..06a3378 100644 --- a/i18n/ko.toml +++ b/i18n/ko.toml @@ -95,4 +95,7 @@ other = "개요" other = "고정" [nojs-message] -other = "내용을 보시려면 자바스크립트를 활성화 해주세요" \ No newline at end of file +other = "내용을 보시려면 자바스크립트를 활성화 해주세요" + +[posts-by-order] +other = "TOP POSTS" \ No newline at end of file diff --git a/i18n/zh.toml b/i18n/zh.toml index 4923aea..68e3656 100644 --- a/i18n/zh.toml +++ b/i18n/zh.toml @@ -95,4 +95,7 @@ other = "总览" other = "固定" [nojs-message] -other = "Please enable Javascript to view the contents" \ No newline at end of file +other = "Please enable Javascript to view the contents" + +[posts-by-order] +other = "TOP POSTS" \ No newline at end of file diff --git a/layouts/partials/sidebar/list/posts-by-order.html b/layouts/partials/sidebar/list/posts-by-order.html index b2f6b73..3a42227 100644 --- a/layouts/partials/sidebar/list/posts-by-order.html +++ b/layouts/partials/sidebar/list/posts-by-order.html @@ -4,15 +4,24 @@ {{ $filteredSections = (where $filteredSections "Type" "!=" (lower .)) }} {{ end }} - - - + {{ end }} + + {{ if $hasOrder }} + + + + {{ end }} {{ end }} \ No newline at end of file