diff --git a/Cargo.lock b/Cargo.lock index faa5254b..54b673eb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2817,6 +2817,7 @@ dependencies = [ "notify", "open", "rebuild", + "search", "site", "termcolor", "tokio", diff --git a/Cargo.toml b/Cargo.toml index 453eaeb1..73393077 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,6 +41,7 @@ errors = { path = "components/errors" } front_matter = { path = "components/front_matter" } utils = { path = "components/utils" } rebuild = { path = "components/rebuild" } +search = { path = "components/search" } [workspace] members = [ diff --git a/components/search/Cargo.toml b/components/search/Cargo.toml index 886c8f50..04326df0 100644 --- a/components/search/Cargo.toml +++ b/components/search/Cargo.toml @@ -12,3 +12,8 @@ lazy_static = "1" errors = { path = "../errors" } library = { path = "../library" } config = { path = "../config" } + +[features] +default = [] +indexing-zh = ["elasticlunr-rs/zh"] +indexing-ja = ["elasticlunr-rs/ja"] diff --git a/docs/content/documentation/content/multilingual.md b/docs/content/documentation/content/multilingual.md index b9541fa7..443e7e49 100644 --- a/docs/content/documentation/content/multilingual.md +++ b/docs/content/documentation/content/multilingual.md @@ -20,6 +20,12 @@ languages = [ If you want to use per-language taxonomies, ensure you set the `lang` field in their configuration. +Note: By default, Chinese and Japanese search indexing is not included. You can include +the support by building `zola` using `cargo build --features search/indexing-ja search/indexing-zh`. +Please also note that, enabling Chinese indexing will increase the binary size by approximately +5 MB while enabling Japanese indexing will increase the binary size by approximately 70 MB +due to the incredibly large dictionaries. + ## Content Once the languages have been added, you can start to translate your content. Zola uses the filename to detect the language: