From ad3f9687c6ff7eb0177f4878917cf2cc8906fcde Mon Sep 17 00:00:00 2001 From: jutty Date: Sat, 20 Dec 2025 21:27:33 -0300 Subject: [PATCH] Add 'hidden' node attribute --- src/types.rs | 3 +++ templates/index.html | 2 +- templates/tree.html | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/types.rs b/src/types.rs index 85c2a89..bb1c042 100644 --- a/src/types.rs +++ b/src/types.rs @@ -23,6 +23,8 @@ pub struct Node { pub links: Vec, #[serde(default)] pub id: String, + #[serde(default)] + pub hidden: bool, #[serde(skip_serializing_if = "Option::is_none")] pub connections: Option>, @@ -148,6 +150,7 @@ impl Node { }, connections: None, links: vec![], + hidden: false, } } } diff --git a/templates/index.html b/templates/index.html index 1916b56..34ae97f 100644 --- a/templates/index.html +++ b/templates/index.html @@ -35,7 +35,7 @@ {% if nodes and config.index_node_list %}
    {% 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 %}
  • {{node.title}}
  • {% endif %} {% endfor %} diff --git a/templates/tree.html b/templates/tree.html index 1f4f26e..563d071 100644 --- a/templates/tree.html +++ b/templates/tree.html @@ -48,7 +48,7 @@ {% if nodes %}

    All nodes

      - {% for node in nodes %} + {% for node in nodes | filter(attribute="hidden", value=false)%}
    • {{node.title}} {% if node.connections or config.tree_node_text %}