2021-04-07 17:49:56 +00:00
|
|
|
{% import "sort" %}
|
|
|
|
{% import "path" %}
|
|
|
|
{% import "github.com/bouncepaw/mycorrhiza/util" %}
|
|
|
|
|
|
|
|
Subhyphae links are recursive. It may end up looking like that if drawn with
|
|
|
|
pseudographics:
|
|
|
|
╔══════════════╗
|
2022-08-06 08:45:10 +00:00
|
|
|
║Foo ║ The presented hyphae are ./foo and ./foo/bar
|
2021-04-07 17:49:56 +00:00
|
|
|
║╔════════════╗║
|
|
|
|
║║Bar ║║
|
|
|
|
║╚════════════╝║
|
|
|
|
╚══════════════╝
|
|
|
|
{% func childHTML(c *child) %}
|
|
|
|
{% code
|
|
|
|
sort.Slice(c.children, func(i, j int) bool {
|
|
|
|
return c.children[i].name < c.children[j].name
|
|
|
|
})
|
|
|
|
%}
|
|
|
|
<li class="subhyphae__entry">
|
2021-10-01 09:18:11 +00:00
|
|
|
<a class="subhyphae__link {% if !c.exists %}wikilink_new{% endif %}" href="/hypha/{%s c.name %}">
|
2021-04-07 17:49:56 +00:00
|
|
|
{%s util.BeautifulName(path.Base(c.name)) %}
|
|
|
|
</a>
|
|
|
|
{% if len(c.children) > 0 %}
|
|
|
|
<ul>
|
|
|
|
{% for _, child := range c.children %}
|
|
|
|
{%s= childHTML(&child) %}
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
{% endif %}
|
|
|
|
</li>
|
|
|
|
{% endfunc %}
|
|
|
|
|