hexo-generator-i18n-tag
v1.0.0
Published
Hexo plugin for generating i18n tag pages with language-specific filtering
Maintainers
Readme
hexo-generator-i18n-tag
Hexo plugin for generating i18n tag pages with language-specific filtering and sorting.
Features
- Generates tag pages for each language
- Filters posts by language
- Sorts posts with redirect posts (original_lang_url) appearing last
- Supports pagination
- Can be toggled on/off via configuration
Installation
Add to your package.json:
{
"dependencies": {
"hexo-generator-i18n-tag": "file:../hexo-generator-i18n-tag"
}
}Configuration
In _config.yml:
# Enable/disable the plugin (default: true)
i18n_tag_generator:
enable: true
per_page: 10 # Posts per page (default: 10)
order_by: -date # Sort order (default: -date)Configuration Options
enable: Enable/disable the plugin (default:true)per_page: Number of posts per page (default:10)order_by: Sort order for posts (default:-date)-date: Newest firstdate: Oldest first-title: Reverse alphabetical by titletitle: Alphabetical by title
To disable:
i18n_tag_generator:
enable: falseUsage
The plugin automatically generates tag pages for all configured languages. No additional configuration needed beyond the standard Hexo language settings.
I18n Structure
The plugin generates language-specific tag pages based on your Hexo language configuration:
- Default language: Tags at
/tags/{tag}/(root level) - Other languages: Tags at
/{lang}/tags/{tag}/
Example with language: ['en', 'zh-TW', 'zh-CN']:
/tags/javascript/ # English (default language)
/zh-TW/tags/javascript/ # Traditional Chinese
/zh-CN/tags/javascript/ # Simplified ChineseOriginal Language URL Support
Posts with original_lang_url metadata are sorted with lowest priority in tag pages:
- Purpose: Indicates content is only available in original language
- Behavior: Shows redirect notice instead of content
- Ordering: Posts with
original_lang_urlappear last in tag pages - Messages: Automatically localized based on post language
Example post with original language URL:
---
title: "Post Title"
lang: zh-TW
tags: [javascript, nodejs]
original_lang_url: "/en/original-post/"
---