Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Generate i18n alphabetical archive for Hexo.

It will generate a :lang/archive.html for each language, the archive page is sorted by alphabet.

Impressed by hexo-generator-archive-alphabet and hexo-generator-archive.

It's the i18n version of hexo-generator-archive-alphabet.

NOTICE: You can only choose one of the two plugins, hexo-generator-archive or hexo-generator-archive-alphabet-i18n.

NOTICE: You should probably need to modify your theme's archive template to adapt this plugin. See Usage for more information.

A live site using this plugin:

And the GitHub repo for that site:

For an non-i18n version of this plugin:


$ npm install hexo-generator-archive-alphabet-i18n --save


After using this plugin, every posts will come up with an additional property alphabet, which means the first letter of the title of the post.

There are several rules of alphabet, let's see some examples:

Title alphabet Explanation
Hello World H The normal one
banana B alphabet will always be uppercase
1 world # If first letter is number, then alphabet will be #
你好中国 N If first letter is unicode character, then alphabet will be the translated first letter
_tail _ If first letter is other character, then alphabet will be _
.dotfile _ As above

Tip: You can easily compare the alphabet, it will return a common sense result:

'#' < 'A' // true
'A' < 'B' // true
'Z' < '_' // true

You should probably need to modify your theme's archive template to adapt this plugin.

Or you can choose a theme that support this plugin. Like

Here is an example archive template:

<!DOCTYPE html>
    <div class="container">
    var lastAlphabet = '';
    page.posts.forEach(post => {
      if (typeof post.alphabet === 'undefined') post.alphabet = '_';
      if (lastAlphabet !== post.alphabet) {
        lastAlphabet = post.alphabet; %>
        <h3 class="words-title"><%= lastAlphabet %></h3>
      <% } %>
      <a class="word" href="<%= url_for(post.path) %>">
        <%= post.title %>
    <% }) %>

See ??? for more details.


  per_page: 10
  • per_page: Posts displayed per page. (0 = disable pagination)


Generate i18n alphabetical archive for Hexo


You can’t perform that action at this time.