Suggestion: Set Language for specific Posts
Currently, the project only supports a single global language setting. However, I would like to propose a solution for users like myself who wish to publish posts in multiple languages, specifically Chinese and English.
I suggest adding a "language" field as optional frontmatter for each post. Users could then specify the language of their posts using tags such as "en" for English, "zh" for Chinese (also "zh_TW", "zh_HK", etc.), and "jp" for Japanese.
Also, thanks for the amazing project :3
Thanks for your suggestion, but I’m a bit unclear on what the language field should actually do. Could you please explain further?
By default, the starting tag of <html> contains lang which defines the global language of the entire webpage. According to my test, this was reflected by the value lang set in SiteConfig (/src/config.ts).
In my expectation, the example frontmatter of a post should be like this:
---
title: Hello World
description: Here goes the description
published: 2024-08-12
draft: false
category: Casual
tags: []
language: en
---
Where the language field defines the language of the post, and overwrites the value in <html lang="">.
For bloggers who have the need to write articles in multiple languages, being able to set language for a single post offers a better advantage for search engine crawling, which is also a type of SEO.
Closed as #151 has been merged.