Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

home source realm

Package home is zôÖma's profile page on gno.land.

Overview

Package home is zôÖma's profile page on gno.land.

gnoweb renders a profile by calling Render("") on the realm at exactly /r/<namespace>/home, so this path carries no /vN suffix.

The page is assembled from SLOTS: named markdown fragments, one Set transaction each. The slot named "layout" is the template; every :slug: placeholder in it is replaced by the slot of that name, in a single pass. init seeds every slot from content.gno, so the page is complete the block it goes live and later edits are data, not redeploys.

One thing on this page is not written by its owner: visitors can send a heart (<3), one per address, and the page counts them.

Functions 11

func Append

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

Append adds to the end of a slot, creating it when absent, for bodies too large for one transaction.

func Delete

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

Delete removes a slot. Deleting "layout" falls back to the built-in layout.

func Get

Action
1func Get(slug string) string
source

Get returns a slot body, or "" when the slot does not exist.

func HasHeart

Action
1func HasHeart(addr address) bool
source

HasHeart reports whether addr already sent a <3.

func Heart

crossing Action
1func Heart(cur realm)
source

Heart records one <3 from the caller. Each address can send exactly one.

func Hearts

Action
1func Hearts() int
source

Hearts returns how many distinct addresses sent a <3.

func Render

1func Render(path string) string
source

Render serves:

Example
1""             the profile page
2"slots"        the slot index
3"slots/<slug>" one slot's raw markdown
4"hearts"       everyone who sent a <3

func Set

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

Set creates or replaces one slot.

func SetGallery

crossing Action
1func SetGallery(cur realm, name, spec string)
source

SetGallery replaces a whole gallery from its line format.

Imports 5

Source Files 7