all repos — flounder @ 3fb8fb8a30e4be06a5582316ce84fe6a12b75ee3

A small site builder for the Gemini protocol

Make progress on nested folder template
alex wennerberg alex@alexwennerberg.com
Fri, 13 Nov 2020 01:07:26 -0800
commit

3fb8fb8a30e4be06a5582316ce84fe6a12b75ee3

parent

3b6a527b8800e325039859b533049eeff5b061c2

1 files changed, 13 insertions(+), 8 deletions(-)

jump to
M templates/my_site.htmltemplates/my_site.html

@@ -8,24 +8,25 @@ </a>

</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,11 +42,15 @@ type="submit"

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>