From 0c5b697fd3b283b6a5c926742b61ed49d8688c18 Mon Sep 17 00:00:00 2001
From: Cotes Chung <11371340+cotes2020@users.noreply.github.com>
Date: Tue, 20 Sep 2022 15:25:09 +0800
Subject: [PATCH] fix: correct the i18n for tab titles
---
_layouts/page.html | 3 ++-
_tabs/about.md | 2 +-
_tabs/archives.md | 1 -
_tabs/categories.md | 1 -
_tabs/tags.md | 1 -
5 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/_layouts/page.html b/_layouts/page.html
index f62d84d..d5597fb 100644
--- a/_layouts/page.html
+++ b/_layouts/page.html
@@ -20,7 +20,8 @@ layout: default
{% endif %}
{% endcapture %}
- {% if page.layout == 'page' or page.collection == 'tabs'%}
+ {% if page.collection == 'tabs' %}
+ {% assign tab_key = page.title | downcase %}
{% assign title = site.data.locales[lang].tabs[tab_key] | default: page.title %}
{{ title }}
diff --git a/_tabs/about.md b/_tabs/about.md
index 9f0b95f..ddb2bc4 100644
--- a/_tabs/about.md
+++ b/_tabs/about.md
@@ -1,5 +1,5 @@
---
-title: About
+# the default layout is 'page'
icon: fas fa-info-circle
order: 4
---
diff --git a/_tabs/archives.md b/_tabs/archives.md
index f969f92..1b42e95 100644
--- a/_tabs/archives.md
+++ b/_tabs/archives.md
@@ -1,6 +1,5 @@
---
layout: archives
-title: Archives
icon: fas fa-archive
order: 3
---
diff --git a/_tabs/categories.md b/_tabs/categories.md
index 3a23c29..2d241be 100644
--- a/_tabs/categories.md
+++ b/_tabs/categories.md
@@ -1,6 +1,5 @@
---
layout: categories
-title: Categories
icon: fas fa-stream
order: 1
---
diff --git a/_tabs/tags.md b/_tabs/tags.md
index 2108d24..c8e213a 100644
--- a/_tabs/tags.md
+++ b/_tabs/tags.md
@@ -1,6 +1,5 @@
---
layout: tags
-title: Tags
icon: fas fa-tag
order: 2
---