1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00

Added /v /l to Fix #51

This commit is contained in:
Zack Scholl 2016-06-29 19:55:59 -04:00
parent 684fb3d18f
commit 705cdf8b87

View File

@ -308,7 +308,7 @@ func editNote(c *gin.Context) {
func everythingElse(c *gin.Context) {
option := c.Param("option")
title := c.Param("title")
if option == "/view" {
if option == "/view" || option == "/v" {
version := c.DefaultQuery("version", "-1")
noprompt := c.DefaultQuery("noprompt", "-1")
versionNum, _ := strconv.Atoi(version)
@ -340,7 +340,7 @@ func everythingElse(c *gin.Context) {
c.Data(200, contentType(title), []byte(currentText))
} else if title == "ls" && option == "/"+RuntimeArgs.AdminKey && len(RuntimeArgs.AdminKey) > 1 {
renderMarkdown(c, listEverything(), "ls", nil, RuntimeArgs.AdminKey, time.Now().Sub(time.Now()), false, false, false, []string{})
} else if option == "/list" {
} else if option == "/list" || option == "/l" {
renderList(c, title)
} else if title == "static" {
serveStaticFile(c, option)