Add 'hidden' node attribute
This commit is contained in:
parent
77d08036c6
commit
ad3f9687c6
3 changed files with 5 additions and 2 deletions
|
|
@ -23,6 +23,8 @@ pub struct Node {
|
||||||
pub links: Vec<String>,
|
pub links: Vec<String>,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
#[serde(default)]
|
||||||
|
pub hidden: bool,
|
||||||
|
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub connections: Option<Vec<Edge>>,
|
pub connections: Option<Vec<Edge>>,
|
||||||
|
|
@ -148,6 +150,7 @@ impl Node {
|
||||||
},
|
},
|
||||||
connections: None,
|
connections: None,
|
||||||
links: vec![],
|
links: vec![],
|
||||||
|
hidden: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
{% if nodes and config.index_node_list %}
|
{% if nodes and config.index_node_list %}
|
||||||
<ul>
|
<ul>
|
||||||
{% for node in nodes | slice(end=config.index_node_count) %}
|
{% 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>
|
<li><a href="/node/{{node.id}}">{{node.title}}</a></li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@
|
||||||
{% if nodes %}
|
{% if nodes %}
|
||||||
<h2>All nodes</h2>
|
<h2>All nodes</h2>
|
||||||
<ul>
|
<ul>
|
||||||
{% for node in nodes %}
|
{% for node in nodes | filter(attribute="hidden", value=false)%}
|
||||||
<li>
|
<li>
|
||||||
<a href="/node/{{node.id}}">{{node.title}}</a>
|
<a href="/node/{{node.id}}">{{node.title}}</a>
|
||||||
{% if node.connections or config.tree_node_text %}
|
{% if node.connections or config.tree_node_text %}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue