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

Added coding types

This commit is contained in:
Zack Scholl
2016-03-28 21:15:23 -04:00
parent bdce4b6198
commit 6d38da9c02
9 changed files with 10712 additions and 4 deletions

View File

@@ -240,6 +240,16 @@ func editNote(c *gin.Context) {
if totalTime.Seconds() < 1 {
totalTimeString = "< 1 s"
}
CodeType := ""
if strings.Contains(title, ".js") {
CodeType = "javascript"
} else if strings.Contains(title, ".py") {
CodeType = "python"
} else if strings.Contains(title, ".go") {
CodeType = "go"
} else if strings.Contains(title, ".html") {
CodeType = "htmlmixed"
}
c.HTML(http.StatusOK, "index.tmpl", gin.H{
"Title": title,
"WikiName": RuntimeArgs.WikiName,
@@ -250,6 +260,8 @@ func editNote(c *gin.Context) {
"TotalTime": totalTimeString,
"SocketType": RuntimeArgs.Socket,
"NoEdit": !currentVersion,
"Coding": len(CodeType) > 0,
"CodeType": CodeType,
})
}
}