From 1b1460c8d4fa358433c51fd5293fd1c79f32aeff Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Mon, 1 Jul 2024 23:32:54 +0200 Subject: feat: Add pathing to the tree tab --- templates/gititemblob.qtpl | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'templates/gititemblob.qtpl') diff --git a/templates/gititemblob.qtpl b/templates/gititemblob.qtpl index f9bab3d..ca3a1fa 100644 --- a/templates/gititemblob.qtpl +++ b/templates/gititemblob.qtpl @@ -1,6 +1,8 @@ +{% import "git.gabrielgio.me/cerrado/pkg/u" %} + {% code type GitItemBlobPage struct { - File string + Path []string Content []byte } %} @@ -8,6 +10,19 @@ type GitItemBlobPage struct { {% func (g *GitItemBlobPage) Nav(name, ref string) %}{%= GitItemNav(name, ref, Tree) %}{% endfunc %} {% func (g *GitItemBlobPage) GitContent(name, ref string) %} +
+ {% stripspace %} + {% if len(g.Path) != 0 %} + root/ + {% for i, e := range g.Path[:len(g.Path)-1] %} + {%s e %}/ + {% endfor %} + {%s u.LastOrZero(g.Path) %} + {% else %} + root/ + {% endif %} + {% endstripspace %} +
{%z= g.Content %}
-- cgit v1.2.3