hexo-lang-switcher-btn

add a button to switch language

Usage no npm install needed!

<script type="module">
  import hexoLangSwitcherBtn from 'https://cdn.skypack.dev/hexo-lang-switcher-btn';
</script>

README

Useage

added this to _config.yml

langswitch:
  en: Read the English version
  tw: 閱讀中文版

added to your post

{% langswitch en [0,1] %}

0 will not use lang as a part of url.

example:

{% langswitch en 0 %} will generate a url: / {% langswitch en %} will generate a url: /e/