diff --git a/config.toml b/config.toml index 7626d44..bda482f 100644 --- a/config.toml +++ b/config.toml @@ -6,6 +6,7 @@ author = "Salar Rahmanian" generate_feed = true compile_sass = true minify_html = true +build_search_index = true # To translate the entire theme, there must be a file with the same ISO 639-1 # (or IETF BCP 47) Code in the `i18n` folder of your site or the tabi theme @@ -19,6 +20,22 @@ taxonomies = [ {name = "tags", feed = true}, ] +[search] +# Whether to include the title of the page/section in the index. +include_title = true +# Whether to include the description of the page/section in the index. +include_description = true +# Whether to include the path of the page/section in the index. +include_path = true +# Whether to include the rendered content of the page/section in the index. +include_content = true +# At which character to truncate the content to. Useful if you have a lot of pages and the index would +# become too big to load on the site. Defaults to not being set. +# truncate_content_length = 100 +# Wether to produce the search index as a javascript file or as a JSON file. +# Accepted value "elasticlunr_javascript" or "elasticlunr_json". +index_format = "elasticlunr_json" + [markdown] highlight_code = true highlight_theme = "css" diff --git a/flake.lock b/flake.lock index a8a6541..cf55e4b 100644 --- a/flake.lock +++ b/flake.lock @@ -25,17 +25,17 @@ "theme": { "flake": false, "locked": { - "lastModified": 1704495088, - "narHash": "sha256-ZfN0qTw2yO+/zU5hkWlB/lOXSJPdcFfVduYUOoSor3A=", + "lastModified": 1707564545, + "narHash": "sha256-m0XIxf3yKBKJwbSonAPDjw7DPHDi0BgRMhhD3FArWA4=", "owner": "welpo", "repo": "tabi", - "rev": "7fa208a2a5dffbc83dd2b71de1e804c2f2eaad01", + "rev": "7e428c899b1bf595100e1448578f9cfc84ad3355", "type": "github" }, "original": { "owner": "welpo", "repo": "tabi", - "rev": "7fa208a2a5dffbc83dd2b71de1e804c2f2eaad01", + "rev": "7e428c899b1bf595100e1448578f9cfc84ad3355", "type": "github" } } diff --git a/flake.nix b/flake.nix index 2832b3d..09ca219 100644 --- a/flake.nix +++ b/flake.nix @@ -4,7 +4,7 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable"; theme = { - url = "github:welpo/tabi/7fa208a2a5dffbc83dd2b71de1e804c2f2eaad01"; + url = "github:welpo/tabi/7e428c899b1bf595100e1448578f9cfc84ad3355"; flake = false; }; }; diff --git a/templates/partials/footer.html b/templates/partials/footer.html index d058c40..7b0e77c 100644 --- a/templates/partials/footer.html +++ b/templates/partials/footer.html @@ -102,5 +102,10 @@ {%- if email_needs_decoding -%} {%- endif -%} + + {# Modal structure for search #} + {%- if config.build_search_index -%} + {% include "partials/search_modal.html" %} + {%- endif -%} diff --git a/templates/partials/header.html b/templates/partials/header.html index 0c50fa2..48d4d06 100644 --- a/templates/partials/header.html +++ b/templates/partials/header.html @@ -1,6 +1,7 @@
+ {# Site title #}