Make HTML lang attribute configurable

This commit is contained in:
Juno Takano 2025-12-23 21:40:31 -03:00
commit ffead4fb47
2 changed files with 7 additions and 0 deletions

View file

@ -96,6 +96,8 @@ pub struct Config {
pub tree_node_text: bool,
#[serde(default = "mkfalse")]
pub ascii_dom_ids: bool,
#[serde(default)]
pub content_language: String,
}
// See: https://github.com/serde-rs/serde/issues/368
@ -136,6 +138,7 @@ impl Graph {
index_root_node: true,
tree_node_text: false,
ascii_dom_ids: false,
content_language: String::new(),
},
version: (0, 1, 0),
messages: message.map_or(vec![], |m| vec![m]),

View file

@ -1,5 +1,9 @@
<!DOCTYPE html>
{% if config.content_language %}
<html lang="{{ config.content_language }}">
{% else %}
<html>
{% endif %}
<head>
{% if config.site_title %}
<title>{% block title %}{% endblock title %} &bullet; {{config.site_title}}</title>