Add new gemlog post link
alex wennerberg alex@alexwennerberg.com
Sun, 27 Dec 2020 14:40:18 -0800
2 files changed,
10 insertions(+),
5 deletions(-)
M
http.go
→
http.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.html
→
templates/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" />