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 state

Back to all declarations

toriiMask

untyped string

toriiMask is the Samouraï Coop mark, redrawn as vectors: a torii gate cut out of a full circle, in a 480x480 box. Everything painted through the mask takes the shape of the mark.

Value

"<mask id=\"torii\"><circle cx=\"238\" cy=\"240\" r=\"240\" fill=\"#fff\"/><g fill=\"#000\"><path d=\"M-10 90 Q238 164 490 90 L490 140 Q238 190 -10 140 Z\"/><path d=\"M102 140 L165 140 L162 206 L96 206 Z\"/><path d=\"M302 140 L364 140 L370 206 L304 206 Z\"/><rect x=\"-10\" y=\""...

heroText

type

Value

home.heroText

heroSVG

func(h home.heroText) string

heroSVG draws the page banner: the mark set in a red sun on the right, the text stack on the left.

Open
OID
0e0cc2…9520:3
heroSVG details

Inspect func

home

untyped string

Value

"/r/g1747t5m2f08plqjlrjk2q0qld7465hxz8gkx59c/home"

memba

untyped string

Value

"https://memba.samourai.app/mainnet"

yt

untyped string

Value

"https://www.youtube.com/watch?v="

gh

untyped string

Value

"https://github.com/samouraiworld/"

galleryPrefix

untyped string

Value

"gallery."

cardsPerRow

untyped bigint

Value

(3 <untyped> bigint)

maxCards

untyped bigint

Value

(48 <untyped> bigint)

maxTitleLen

untyped bigint

Value

(80 <untyped> bigint)

maxMetaLen

untyped bigint

Value

(80 <untyped> bigint)

maxDescLen

untyped bigint

Value

(200 <untyped> bigint)

card

type

Value

home.card

style

type

Value

home.style

styleOf

func(kind string) home.style
Open
OID
0e0cc2…9520:55
styleOf details

Inspect func

SetGallery

func(name string, spec string)

SetGallery replaces a whole gallery from its line format.

Open
OID
0e0cc2…9520:57
SetGallery details

Inspect func

DeleteGallery

func(name string)

DeleteGallery removes a gallery.

Open
OID
0e0cc2…9520:58
DeleteGallery details

Inspect func

parseGallery

func(spec string) []home.card
Open
OID
0e0cc2…9520:59
parseGallery details

Inspect func

renderGallery

func(name string) (string, bool)

renderGallery lays cards out cardsPerRow to a row, each one a poster that links to its target.

Open
OID
0e0cc2…9520:60
renderGallery details

Inspect func

linkTitle

func(desc string) string

linkTitle renders an optional markdown link title, which gnoweb emits as the link's hover text.

Open
OID
0e0cc2…9520:61
linkTitle details

Inspect func

mdText

func(s string) string

mdText keeps a title from closing the markdown image alt text early.

Open
OID
0e0cc2…9520:62
mdText details

Inspect func

wrap

func(s string, width int) []string

wrap splits s into at most two lines of about width runes; the second line is cut with an ellipsis when the title is longer.

Open
OID
0e0cc2…9520:64
wrap details

Inspect func

clip

func(s string, n int) string

clip cuts s to at most n runes, ending with an ellipsis when it had to cut.

Open
OID
0e0cc2…9520:66
clip details

Inspect func

posterURI

func(c home.card) string
Open
OID
0e0cc2…9520:67
posterURI details

Inspect func

poster

func(c home.card) string

poster draws a 320x180 card: a dark gradient, a rising sun in the kind's accent (a play button for videos), a large kanji watermark, the kind label, the title on up to two lines and a meta line.

Open
OID
0e0cc2…9520:68
poster details

Inspect func

admin

.uverse.address

admin is the only address allowed to edit slots.

Value

<gnolang.StringValue>

layoutSlug

untyped string

Value

"layout"

maxSlugLen

untyped bigint

Value

(64 <untyped> bigint)

maxRecent

untyped bigint

Value

(7 <untyped> bigint)

slot

type

Value

home.slot

rev

int

// total slot writes

Value

15

hearts

*v0.Tree

// address string -> int64 height of the heart

Open
OID
0e0cc2…9520:75
hearts details

Inspect pointer

recent

[].uverse.address (len=2)

// newest first, at most maxRecent

Open
OID
0e0cc2…9520:315
recent details (len=2)

+2 more Inspect slice

reservedSlugs

[]string (len=6)

reservedSlugs are placeholders computed at render time. A slot may not take one of these names, so nothing a slot says can shadow chain state.

Open
OID
0e0cc2…9520:79
reservedSlugs details (len=6)

+6 more Inspect slice

validSlug

func(slug string) bool
Open
OID
0e0cc2…9520:83
validSlug details

Inspect func

assertWritableSlug

func(slug string)
Open
OID
0e0cc2…9520:84
assertWritableSlug details

Inspect func

Set

func(slug string, body string)

Set creates or replaces one slot.

Open
OID
0e0cc2…9520:85
Set details

Inspect func

Append

func(slug string, body string)

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

Open
OID
0e0cc2…9520:86
Append details

Inspect func

Delete

func(slug string)

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

Open
OID
0e0cc2…9520:87
Delete details

Inspect func

Get

func(slug string) string

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

Open
OID
0e0cc2…9520:88
Get details

Inspect func

Revision

func() int

Revision is the total number of slot writes accepted.

Open
OID
0e0cc2…9520:89
Revision details

Inspect func

Heart

func()

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

Open
OID
0e0cc2…9520:90
Heart details

Inspect func

Hearts

func() int

Hearts returns how many distinct addresses sent a \<3.

Open
OID
0e0cc2…9520:91
Hearts details

Inspect func

HasHeart

func(addr .uverse.address) bool

HasHeart reports whether addr already sent a \<3.

Open
OID
0e0cc2…9520:92
HasHeart details

Inspect func

realmPath

untyped string

Value

"gno.land/r/g1747t5m2f08plqjlrjk2q0qld7465hxz8gkx59c/home"

webPath

untyped string

Value

"/r/g1747t5m2f08plqjlrjk2q0qld7465hxz8gkx59c/home"

fallbackLayout

untyped string

fallbackLayout renders when the layout slot is deleted.

Value

"# zôÖma\n\n:bio:\n\n:hearts:\n"

Render

func(path string) string

Render serves: "" the profile page "slots" the slot index "slots/<slug>" one slot's raw markdown "hearts" everyone who sent a <3

Open
OID
0e0cc2…9520:93
Render details

Inspect func

fill

func(s string) string

fill replaces every :slug: in s, in one left-to-right pass. Replacement text is never rescanned, so a slot cannot expand into another slot. A placeholder with no value stays verbatim: a missing section should be visible.

Open
OID
0e0cc2…9520:96
fill details

Inspect func

lookup

func(slug string) (string, bool)
Open
OID
0e0cc2…9520:97
lookup details

Inspect func

renderSlot

func(slug string) string
Open
OID
0e0cc2…9520:102
renderSlot details

Inspect func
toriiMask : untyped string ="<mask id=\"torii\"><circle cx=\"238\" cy=\"240\" r=\"240\" fill=\"#fff\"/><g fill=\"#000\"><path d=\"M-10 90 Q238 164 490 90 L490 140 Q238 190 -10 140 Z\"/><path d=\"M102 140 L165 140 L162 206 L96 206 Z\"/><path d=\"M302 140 L364 140 L370 206 L304 206 Z\"/><rect x=\"-10\" y=\""...
heroText : type =home.heroText
heroSVG : func(h home.heroText) string Inspect
heroImage : func() string Inspect
home : untyped string ="/r/g1747t5m2f08plqjlrjk2q0qld7465hxz8gkx59c/home"
memba : untyped string ="https://memba.samourai.app/mainnet"
hero : home.heroText Inspect
defaultSlots : []struct{...} (len=15) Inspect
yt : untyped string ="https://www.youtube.com/watch?v="
gh : untyped string ="https://github.com/samouraiworld/"
defaultGalleries : []struct{...} (len=9) Inspect
galleryPrefix : untyped string ="gallery."
cardsPerRow : untyped bigint =(3 <untyped> bigint)
maxCards : untyped bigint =(48 <untyped> bigint)
maxTitleLen : untyped bigint =(80 <untyped> bigint)
maxMetaLen : untyped bigint =(80 <untyped> bigint)
maxDescLen : untyped bigint =(200 <untyped> bigint)
card : type =home.card
galleries : *v0.Tree Inspect
style : type =home.style
styles : map[string]home.style Inspect
styleOf : func(kind string) home.style Inspect
SetGallery : func(name string, spec string) Inspect
DeleteGallery : func(name string) Inspect
parseGallery : func(spec string) []home.card Inspect
renderGallery : func(name string) (string, bool) Inspect
linkTitle : func(desc string) string Inspect
mdText : func(s string) string Inspect
xmlText : func(s string) string Inspect
wrap : func(s string, width int) []string Inspect
runeLen : func(s string) int Inspect
clip : func(s string, n int) string Inspect
posterURI : func(c home.card) string Inspect
poster : func(c home.card) string Inspect
itoa : func(n int) string Inspect
admin : .uverse.address =<gnolang.StringValue>
layoutSlug : untyped string ="layout"
maxSlugLen : untyped bigint =(64 <untyped> bigint)
maxRecent : untyped bigint =(7 <untyped> bigint)
slot : type =home.slot
slots : *v0.Tree Inspect
rev : int =15
hearts : *v0.Tree Inspect
recent : [].uverse.address (len=2) Inspect
reservedSlugs : []string (len=6) Inspect
init.45 : func() Inspect
assertAdmin : func() Inspect
validSlug : func(slug string) bool Inspect
assertWritableSlug : func(slug string) Inspect
Set : func(slug string, body string) Inspect
Append : func(slug string, body string) Inspect
Delete : func(slug string) Inspect
Get : func(slug string) string Inspect
Revision : func() int Inspect
Heart : func() Inspect
Hearts : func() int Inspect
HasHeart : func(addr .uverse.address) bool Inspect
realmPath : untyped string ="gno.land/r/g1747t5m2f08plqjlrjk2q0qld7465hxz8gkx59c/home"
webPath : untyped string ="/r/g1747t5m2f08plqjlrjk2q0qld7465hxz8gkx59c/home"
fallbackLayout : untyped string ="# zôÖma\n\n:bio:\n\n:hearts:\n"
Render : func(path string) string Inspect
renderPage : func() string Inspect
fill : func(s string) string Inspect
lookup : func(slug string) (string, bool) Inspect
heartsBlock : func() string Inspect
renderHearts : func() string Inspect
renderIndex : func() string Inspect
renderSlot : func(slug string) string Inspect