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 David G.'s profile page on gno.land.

Overview

Package home is David G.'s profile page on gno.land.

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

The page is a list of sections, each a markdown body the owner edits with one Set transaction, so changing the text never needs a redeploy. The slot named "order" lists the sections to show. Six sections are drawn rather than stored: "hero", the page banner, "banner" and "reviews", the activity charts, "areachart", the ring of pull requests by area, "game", today's Gnordle, and "hearts", the heart count and wall.

Functions 8

func Delete

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

Delete removes one section. Only the admin can call it.

name is the section to remove, "talks" for example. Its name can stay in "order": a name with no section shows nothing.

func Get

Action
1func Get(name string) string
source

Get returns a section's markdown, or "" when it does not exist. Get("order") returns the current section list, the one to edit before setting "order".

func HasHeart

Action
1func HasHeart(addr address) bool
source

HasHeart reports whether addr already sent a heart.

func Heart

crossing Action
1func Heart(cur realm)
source

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

func Hearts

Action
1func Hearts() int
source

Hearts returns how many distinct addresses sent a heart.

func Render

1func Render(path string) string
source

Render serves:

Example
1""             the profile page
2"wordle/..."   the Gnordle game
3"hearts[/<n>]" the addresses that sent a heart, heartsPerPage per page

func Set

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

Set writes one section of the page. Only the admin can call it.

name is the section to write and body is its markdown. The text sections are "header", the bio at the top, then "gno", "projects", "peerdev" and "unrelated"; any other name creates a new section.

name "order" decides which sections show and in which order. Its body lists every section name, comma separated, with no spaces. A name left out of the list is hidden, so copy the current list, from Get("order"), and edit it.

name "herotext" is the banner's text: "key value" pairs split by ";", with the keys kicker, the small line on top, title, subtitle, tagline, footline, the small line at the bottom, and alt, the banner's description for screen readers. A key left out keeps its current default.

"hero", "banner", "reviews", "areachart", "game" and "hearts" are drawn by the page itself: they cannot be set, only placed through "order".

Examples, as the two fields of the form:

Example
 1name: header
 2body: I'm a developer engineer at [Samouraï Coop](https://www.samourai.world/).
 3
 4name: herotext
 5body: title David G.; subtitle Developer engineer at Samouraï Coop; footline Open for contribution
 6
 7name: talks
 8body: ## Talks
 9
10name: order
11body: hero,header,activityhead,banner,reviews,gno,areachart,projects,peerdev,unrelated,talks,game,hearts

func SetActivity

crossing Action
1func SetActivity(cur realm, activity, reviews, areas string)
source

SetActivity refreshes the three charts in one transaction. Only the admin can call it. Its three arguments are the bodies of the "activity", "reviewactivity" and "areas" sections, as scripts/activity.py prints them; an empty argument leaves that chart as it is.

Imports 7

Source Files 11