Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

blog source realm

Package blog is Jae Kwon's personal blog on gno.land, built on gno.land/p/gnoland/blog/v0, the package behind gno.lan...

Overview

Package blog is Jae Kwon's personal blog on gno.land, built on gno.land/p/gnoland/blog/v0, the package behind gno.land's own blog.

Who can do what:

  • The owner (Jae's Ledger key) decides who may write, and can hand the blog to a new owner in two steps, so a typo can't lose it.
  • Writers and the owner add, edit and remove posts.
  • Everyone else can only read.

What this realm adds on top of the package:

  • Render answers only the blog's own routes, with slugs and tags limited to a-z, 0-9, '-' and '_', so nothing typed into a URL is echoed into the page as markdown (the package's tag page echoes it).
  • Edit removes the old post and adds it back, so the home page and the title index never keep a stale copy (the package's in-place edit does).
  • No comments, and nothing hands out a pointer to the blog or a post.

Functions 9

func AddWriter

crossing Action
1func AddWriter(cur realm, addr address)
source

AddWriter lets addr add, edit and remove posts. Owner only.

func Edit

crossing Action
1func Edit(cur realm, slug, title, body, pubDate, authors, tags string)
source

Edit replaces the post at slug. An empty pubDate keeps the old date.

func IsWriter

Action
1func IsWriter(addr address) bool
source

IsWriter reports whether addr may add, edit and remove posts.

func Post

crossing Action
1func Post(cur realm, slug, title, body, pubDate, authors, tags string)
source

Post publishes a new post. pubDate is RFC3339, or empty for the block time. authors and tags are comma-separated.

func ProposeOwner

crossing Action
1func ProposeOwner(cur realm, addr address)
source

ProposeOwner names a new owner, who must then call AcceptOwnership. Owner only. Proposing the empty address cancels a pending proposal.

func Remove

crossing Action
1func Remove(cur realm, slug string)
source

Remove deletes the post at slug.

func RemoveWriter

crossing Action
1func RemoveWriter(cur realm, addr address)
source

RemoveWriter takes writing rights away from addr. Owner only.

func Render

1func Render(path string) string
source

Render shows the blog. Only "", "p/<slug>" and "t/<tag>" are answered; anything else gets "404", so nothing from the URL reaches the page.

Dependencies

Source Files 3