i18n and search functions
Table of Contents
#i18n
Translation in Marisa is done differently from Zola’s built-in way.
We use an object marisa_i18n
in [extra]
section of thene.toml
to define i18n data.
This allows for quick site-specific translation without using any third-party tools, as well as to provide some nicety like matching emoji to text, or using quoted text with string replacement.
= [
{ = "default_icon", ="🔸", = "", = "" },
{ = "date", ="📅", = "Date", = "日期" },
{ = "continue_reading,_$1_mins", ="⏰", = "Continue reading, est. $1 mins", = "继续阅读,大约 $1 分钟" },
The text is then loaded through macros/page-i18n.html
, which handles the i18n automatically, as defined by default_language
.
#search
Marisa currently only support Fuse/Tinysearch
based search indexes, this is chosen based on the actual usage: users likely want a fuzzy search instead of some advanced boolean ops.