github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/examples/gno.land/r/gnoland/blog/gnoblog.gno (about)

     1  package gnoblog
     2  
     3  import (
     4  	"std"
     5  
     6  	"gno.land/p/demo/blog"
     7  )
     8  
     9  var b = &blog.Blog{
    10  	Title:  "Gnoland's Blog",
    11  	Prefix: "/r/gnoland/blog:",
    12  }
    13  
    14  func AddComment(postSlug, comment string) {
    15  	assertIsCommenter()
    16  	assertNotInPause()
    17  
    18  	caller := std.GetOrigCaller()
    19  	err := b.GetPost(postSlug).AddComment(caller, comment)
    20  	checkErr(err)
    21  }
    22  
    23  func Render(path string) string {
    24  	return b.Render(path)
    25  }
    26  
    27  func RenderLastPostsWidget(limit int) string {
    28  	return b.RenderLastPostsWidget(limit)
    29  }
    30  
    31  func PostExists(slug string) bool {
    32  	if b.GetPost(slug) == nil {
    33  		return false
    34  	}
    35  	return true
    36  }