aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorverdant <i@glowisle.me>2026-02-28 21:32:52 +0800
committerverdant <i@glowisle.me>2026-02-28 21:32:52 +0800
commit171dda197c1c71ebff9c62568aafcf2fa9b463e3 (patch)
tree9eb49be659bc7e5c11da08792377b6e0f7787dcc
parent9e4981b1e5201ff4ae52128b1d7f73871a8dd0c9 (diff)
downloadblog-171dda197c1c71ebff9c62568aafcf2fa9b463e3.tar.gz
blog-171dda197c1c71ebff9c62568aafcf2fa9b463e3.zip
feat: add multi-language support (English page)
-rw-r--r--content/en/_index.md5
-rw-r--r--content/en/archives.md6
-rw-r--r--content/en/posts/HelloWorld.md10
-rw-r--r--hugo.toml105
-rw-r--r--i18n/en.toml10
-rw-r--r--i18n/zh.toml10
6 files changed, 121 insertions, 25 deletions
diff --git a/content/en/_index.md b/content/en/_index.md
new file mode 100644
index 0000000..8623c34
--- /dev/null
+++ b/content/en/_index.md
@@ -0,0 +1,5 @@
+---
+title: "GlowIsle"
+---
+
+{{< recent-posts >}}
diff --git a/content/en/archives.md b/content/en/archives.md
new file mode 100644
index 0000000..de873df
--- /dev/null
+++ b/content/en/archives.md
@@ -0,0 +1,6 @@
+---
+title: "归档"
+type: "archives"
+comments: false
+showMeta: false
+---
diff --git a/content/en/posts/HelloWorld.md b/content/en/posts/HelloWorld.md
new file mode 100644
index 0000000..5f876cd
--- /dev/null
+++ b/content/en/posts/HelloWorld.md
@@ -0,0 +1,10 @@
+---
+title: 'HelloWorld'
+date: '2026-02-26T14:16:05+08:00'
+slug: "hw"
+categories:
+tags:
+draft: true
+comments: true
+---
+Hello World! This is my first English post.
diff --git a/hugo.toml b/hugo.toml
index 29d4f68..d62a255 100644
--- a/hugo.toml
+++ b/hugo.toml
@@ -3,8 +3,8 @@ title = "映屿"
hasCJKLanguage = true
enableRobotsTXT = true
pagination.pagerSize = 5
-languageCode = "zh-CN"
-copyright = "Copyright © 2024, GlowIsle."
+defaultContentLanguage = "zh-CN"
+copyright = "Copyright © 2024 - 2026, GlowIsle."
[outputFormats]
[outputFormats.RSS]
@@ -39,32 +39,87 @@ tabWidth = 4
category = "categories"
tag = "tags"
-[menu]
-[[menu.main]]
- name = "分类"
- url = "/categories/"
+
+[languages]
+ [languages.zh-cn]
+ languageName = "中文"
+ weight = 1
+ title = "映屿"
+ # 中文菜单
+ [[languages.zh-cn.menu.main]]
+ name = "分类"
+ url = "/categories/"
+ weight = 2
+ [[languages.zh-cn.menu.main]]
+ name = "友人"
+ url = "/links/"
+ weight = 3
+ [[languages.zh-cn.menu.main]]
+ name = "归档"
+ url = "/archives/"
+ weight = 4
+ [[languages.zh-cn.menu.main]]
+ name = "书单"
+ url = "/readings/"
+ weight = 5
+ [[languages.zh-cn.menu.main]]
+ name = "关于"
+ url = "/about/"
+ weight = 6
+ [languages.en]
+ languageName = "English"
+ contentDir = "content/en"
+ title = "GlowIsle"
weight = 2
+ # 英文菜单
+ [[languages.en.menu.main]]
+ name = "Categories"
+ url = "/categories/"
+ weight = 2
+ [[languages.en.menu.main]]
+ name = "Links"
+ url = "/links/"
+ weight = 3
+ [[languages.en.menu.main]]
+ name = "Archives"
+ url = "/archives/"
+ weight = 4
+ [[languages.en.menu.main]]
+ name = "Readings"
+ url = "/readings/"
+ weight = 5
+ [[languages.en.menu.main]]
+ name = "About"
+ url = "/about/"
+ weight = 6
+
+# [menu]
+
+# [[menu.main]]
+# name = "分类"
+# url = "/categories/"
+# weight = 2
+
+# [[menu.main]]
+# name = "友人"
+# url = "/links/"
+# weight = 3
+
+# [[menu.main]]
+# name = "归档"
+# url = "/archives"
+# weight = 3
+
+# [[menu.main]]
+# name = "书单"
+# url = "/readings"
+# weight = 3
-[[menu.main]]
- name = "友人"
- url = "/links/"
- weight = 3
-
-[[menu.main]]
- name = "归档"
- url = "/archives"
- weight = 3
-
-[[menu.main]]
- name = "书单"
- url = "/readings"
- weight = 3
-
-[[menu.main]]
- name = "关于"
- url = "/about"
- weight = 6
+# [[menu.main]]
+# name = "关于"
+# url = "/about"
+# weight = 6
[params]
upvote = true
diff --git a/i18n/en.toml b/i18n/en.toml
new file mode 100644
index 0000000..ffe60fd
--- /dev/null
+++ b/i18n/en.toml
@@ -0,0 +1,10 @@
+lang = "en"
+
+title = "GlowIsle"
+
+[nav]
+categories = "categories"
+readings = "readings"
+links = "links"
+archives = "archives"
+about = "about" \ No newline at end of file
diff --git a/i18n/zh.toml b/i18n/zh.toml
new file mode 100644
index 0000000..dc90ec6
--- /dev/null
+++ b/i18n/zh.toml
@@ -0,0 +1,10 @@
+lang = "zh-CN"
+
+title = "映屿"
+
+[nav]
+categories = "分类"
+readings = "书单"
+links = "友人"
+archives = "归档"
+about = "关于" \ No newline at end of file