- A Hexo plugin that enables seamless switching between multiple language versions of your posts. It is suitable for the hexo next theme.
- Check example here
- only change your post between chinese/english
- a seperate bottom for switching language
- with an automatically generated table of contents for each language.
- clone this repo then
npm install hexo-translation-switch
- organize your post like
---
title: xxxxx
date: 2024-xx-xx xx:xx:xx
categories: xxxx
tags:
- xx
- xx
---
some text....
<!--more-->
{% language_switch %}
{% lang_content en %}
YOUR_ENGLISH_POST_HERE
{% endlang_content %}
{% lang_content zh %}
YOUR_CHINESE_POST_HERE
{% endlang_content %}
- where you can use
language_switch
to put your language switch buttom and uselang_content
to wrap your post in different languages
- only works for hexo next theme.
- if the titles of chinese/english post are the same, the chinese toc will not work.
- some animation does not behave as smoothly as original next theme. (Now fixed)
MIT
thinkwee