1
0
mirror of https://github.com/JustKato/FreePad.git synced 2026-02-23 15:50:46 +02:00

+ Maximum pad length

+ Configurable maximum pad length
+ Refresh pad
+ Archive pad
+ Archives in local client storage
+ Download pad
This commit is contained in:
2022-05-21 16:17:25 +03:00
parent b079c0f637
commit e781daec89
8 changed files with 326 additions and 73 deletions

View File

@@ -23,6 +23,9 @@ func HomeRoutes(router *gin.Engine) {
// Get the post we are looking for.
postName := c.Param("post")
// Get the maximum pad size, so that we may notify the client-side to match server-side
maximumPadSize := helper.GetMaximumPadSize()
// Sanitize the postName
newPostName, err := url.QueryUnescape(postName)
if err == nil {
@@ -33,10 +36,11 @@ func HomeRoutes(router *gin.Engine) {
post := objects.GetPost(postName)
c.HTML(200, "page.html", gin.H{
"title": postName,
"post_content": post.Content,
"last_modified": post.LastModified,
"domain_base": helper.GetDomainBase(),
"title": postName,
"post_content": post.Content,
"maximumPadSize": maximumPadSize,
"last_modified": post.LastModified,
"domain_base": helper.GetDomainBase(),
})
})