blob: ca3a1faaf12d3dc0cf337b42cecfa209ba6a1938 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
{% import "git.gabrielgio.me/cerrado/pkg/u" %}
{% code
type GitItemBlobPage struct {
Path []string
Content []byte
}
%}
{% func (g *GitItemBlobPage) Nav(name, ref string) %}{%= GitItemNav(name, ref, Tree) %}{% endfunc %}
{% func (g *GitItemBlobPage) GitContent(name, ref string) %}
<div class="pathing">
{% stripspace %}
{% if len(g.Path) != 0 %}
<a href="{%s url(name, Folder, ref, Root, []string{}) %}">root/</a>
{% for i, e := range g.Path[:len(g.Path)-1] %}
<a href="{%s url(name, Folder, ref, Root, g.Path[:1+i]) %}">{%s e %}/</a>
{% endfor %}
<a>{%s u.LastOrZero(g.Path) %}</a>
{% else %}
<a>root/</a>
{% endif %}
{% endstripspace %}
</div>
<div class="code-view">
{%z= g.Content %}
</div>
{% endfunc %}
|