mirror of
https://github.com/schollz/cowyo.git
synced 2023-08-10 21:13:00 +03:00
parent
6eacf90e18
commit
85877602e0
@ -300,6 +300,11 @@ func handlePageRequest(c *gin.Context) {
|
||||
FileNames, FileSizes, FileNumChanges, FileLastEdited = DirectoryList()
|
||||
}
|
||||
|
||||
// swap out /view for /read if it is published
|
||||
if p.IsPublished {
|
||||
rawHTML = strings.Replace(rawHTML, "/view", "/read", -1)
|
||||
}
|
||||
|
||||
c.HTML(http.StatusOK, "index.tmpl", gin.H{
|
||||
"EditPage": command[0:2] == "/e", // /edit
|
||||
"ViewPage": command[0:2] == "/v", // /view
|
||||
|
Loading…
Reference in New Issue
Block a user