hexo-generator-i18n-archive
v1.0.0
Published
Hexo plugin for generating i18n archive pages with language-specific filtering
Maintainers
Readme
hexo-generator-i18n-archive
Hexo plugin for generating i18n archive pages with language-specific filtering and yearly, monthly, and daily organization.
Features
- Generates archive pages for each language
- Filters posts by language
- Organizes posts by year, month, and day
- Supports pagination
- Can be toggled on/off via configuration
Installation
Add to your package.json:
{
"dependencies": {
"hexo-generator-i18n-archive": "file:../hexo-generator-i18n-archive"
}
}Configuration
In _config.yml:
# Enable/disable the plugin (default: true)
i18n_archive_generator:
enable: true
per_page: 10
yearly: true
monthly: true
daily: falseTo disable:
i18n_archive_generator:
enable: falseUsage
The plugin automatically generates archive pages for all configured languages. No additional configuration needed beyond the standard Hexo language settings.
I18n Structure
The plugin generates language-specific archive pages based on your Hexo language configuration:
- Default language: Archives at
/archives/(root level) - Other languages: Archives at
/{lang}/archives/
Example with language: ['en', 'zh-TW', 'zh-CN']:
/archives/ # English (default language)
/zh-TW/archives/ # Traditional Chinese
/zh-CN/archives/ # Simplified ChineseWith yearly archives enabled:
/archives/2024/
/zh-TW/archives/2024/
/zh-CN/archives/2024/With monthly archives enabled:
/archives/2024/01/
/zh-TW/archives/2024/01/
/zh-CN/archives/2024/01/With daily archives enabled:
/archives/2024/01/15/
/zh-TW/archives/2024/01/15/
/zh-CN/archives/2024/01/15/Original Language URL Support
Posts with original_lang_url metadata are sorted with lowest priority in archives:
- Purpose: Indicates content is only available in original language
- Behavior: Shows redirect notice instead of content
- Ordering: Posts with
original_lang_urlappear last in archive pages - Messages: Automatically localized based on post language
Example post with original language URL:
---
title: "Post Title"
lang: zh-TW
original_lang_url: "/en/original-post/"
---