/view -> /read when published

Fixes #97
This commit is contained in:
Zack Scholl 2017-11-04 15:23:38 -06:00
parent 6eacf90e18
commit 85877602e0
1 changed files with 5 additions and 0 deletions

View File

@ -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