flounder

A simple gemini site builder
Log | Files | Refs | README | LICENSE

commit 3fb8fb8a30e4be06a5582316ce84fe6a12b75ee3
parent 3b6a527b8800e325039859b533049eeff5b061c2
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Fri, 13 Nov 2020 01:07:26 -0800

Make progress on nested folder template

Diffstat:
Mtemplates/my_site.html | 21+++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/templates/my_site.html b/templates/my_site.html @@ -8,24 +8,25 @@ </h1> {{template "nav.html" .}} <h3>Your files:</h3> -<table> -{{ range .Files }} +{{ define "file" }} <tr> <div> - {{ if .Children }} - <td> + {{ if gt (len .Children) 0 }} + <td colspan="3"> <details> <summary> {{.Name}}/ </summary> + <table> {{ range .Children }} - {{.Name}} + {{ template "file" . }} {{ end }} + </table> </details> </td> {{ else }} <td> - <a href="//{{$authUser}}.{{$domain}}/{{.Name}}"> + <a href="//authUser.domain/{{.Name}}"> {{ .Name }}</a> </td> <td> @@ -41,12 +42,16 @@ onclick="return confirm('Are you sure you want to delete this file?');" value="delete" /> - </td> + </form> {{ end }} - </form> + </td> </div> </tr> {{ end }} +<table> +{{ range .Files }} +{{ template "file" . }} +{{ end }} </table> <h3>Create file by name:</h3> <noscript>Create a new page by going to /edit/[filename]</noscript>