all repos — flounder @ c1ba1a1d082df5c03376ebb44d07234e0b8b1cc6

A small site builder for the Gemini protocol

Add new gemlog post link
alex wennerberg alex@alexwennerberg.com
Sun, 27 Dec 2020 14:40:18 -0800
commit

c1ba1a1d082df5c03376ebb44d07234e0b8b1cc6

parent

9ca9f79a9bb4c14f1d4a3bdd7f136f7dc86b1d4d

2 files changed, 10 insertions(+), 5 deletions(-)

jump to
M http.gohttp.go

@@ -252,12 +252,14 @@ }

// check auth userFolder := getUserDirectory(user.Username) files, _ := getMyFilesRecursive(userFolder, user.Username) + currentDate := time.Now().Format("2006-01-02") data := struct { - Host string - PageTitle string - Files []*File - AuthUser AuthUser - }{c.Host, c.SiteTitle, files, user} + Host string + PageTitle string + Files []*File + AuthUser AuthUser + CurrentDate string + }{c.Host, c.SiteTitle, files, user, currentDate} _ = t.ExecuteTemplate(w, "my_site.html", data) }
M templates/my_site.htmltemplates/my_site.html

@@ -69,6 +69,9 @@ create.href = '/edit/' + input.value

} </script> <br /> +<a href="/edit/gemlog/{{.CurrentDate}}.gmi">New Gemlog Post</a> +<br /> +<br /> <form action="/upload" enctype="multipart/form-data" method="POST"> <input type="file" id="myFile" name="file" multiple /> <input type="submit" value="Upload file" class="button" />