Add 'hidden' node attribute

This commit is contained in:
Juno Takano 2025-12-20 21:27:33 -03:00
commit ad3f9687c6
3 changed files with 5 additions and 2 deletions

View file

@ -23,6 +23,8 @@ pub struct Node {
pub links: Vec<String>,
#[serde(default)]
pub id: String,
#[serde(default)]
pub hidden: bool,
#[serde(skip_serializing_if = "Option::is_none")]
pub connections: Option<Vec<Edge>>,
@ -148,6 +150,7 @@ impl Node {
},
connections: None,
links: vec![],
hidden: false,
}
}
}

View file

@ -35,7 +35,7 @@
{% if nodes and config.index_node_list %}
<ul>
{% for node in nodes | slice(end=config.index_node_count) %}
{% if node.id != root_node.id %}
{% if node.id != root_node.id and not node.hidden %}
<li><a href="/node/{{node.id}}">{{node.title}}</a></li>
{% endif %}
{% endfor %}

View file

@ -48,7 +48,7 @@
{% if nodes %}
<h2>All nodes</h2>
<ul>
{% for node in nodes %}
{% for node in nodes | filter(attribute="hidden", value=false)%}
<li>
<a href="/node/{{node.id}}">{{node.title}}</a>
{% if node.connections or config.tree_node_text %}