gnoblog.gno

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