defaultProfile
func() home.profileData- OID
- 059edf…7885:3
defaultProfile details
defaultBadges
func() []home.badge- OID
- 059edf…7885:5
defaultBadges details
defaultHome
func() stringdefaultHome needs base, so init sets base first.
- OID
- 059edf…7885:6
defaultHome details
defaultWork
untyped stringValue
"## Work on Gno\n\nContributor to gnolang/gno since April 2024 ([my merged PRs](https://github.com/gnolang/gno/pulls?q=is%3Apr+author%3Aomarsy+is%3Amerged)). Some highlights:\n\n| PR | What it did |\n| --- | --- |\n| [#3185](https://github.com/gnolang/gno/pull/31"...
defaultBlog
untyped stringValue
"## Blog\n\n:blog:\n"
defaultGuestbook
untyped stringValue
"## Guestbook\n\nLeave a line. One entry per address.\n\n:guestbook:\n"
homeTab
untyped stringValue
"home"
workTab
untyped stringValue
"work"
blogTab
untyped stringValue
"blog"
guestbookTab
untyped stringValue
"guestbook"
maxTabs
untyped bigintValue
(8 <untyped> bigint)
maxTabName
untyped bigintValue
(20 <untyped> bigint)
maxPageBytes
untyped bigint// so all pages together stay under 128 KB
Value
(16384 <untyped> bigint)
maxLineRunes
untyped bigintValue
(140 <untyped> bigint)
maxBadges
untyped bigintValue
(6 <untyped> bigint)
maxSlugBytes
untyped bigintValue
(60 <untyped> bigint)
maxTitleRunes
untyped bigintValue
(100 <untyped> bigint)
pageSize
untyped bigintValue
(20 <untyped> bigint)
latestPosts
untyped bigintValue
(3 <untyped> bigint)
seqWidth
untyped bigintValue
(10 <untyped> bigint)
errUnauthorized
untyped stringValue
"home: unauthorized"
errMasterKey
untyped stringValue
"home: needs the master key, not a session key"
errOwnerOnly
untyped stringValue
"home: owner only"
errPendingOnly
untyped stringValue
"home: pending owner only"
errInvalidInput
untyped stringValue
"home: invalid input: "
errSigned
untyped stringValue
"home: already signed"
errNoEntry
untyped stringValue
"home: no such entry"
errNoTab
untyped stringValue
"home: no such tab"
errNoPost
untyped stringValue
"home: no such post"
errTabsRequired
untyped stringValue
"home: home, blog and guestbook tabs are required"
errUgnotOnly
untyped stringValue
"home: send ugnot only"
profileData
typeValue
home.profileData
badge
typeValue
home.badge
nowLine
typeValue
home.nowLine
entry
typeValue
home.entry
post
typepost dates are UTC days of the block time, "2006-01-02".
Value
home.post
tipStats
typeValue
home.tipStats
owner
.uverse.addressValue
<gnolang.StringValue>
pendingOwner
.uverse.address// set by TransferOwnership, cleared by AcceptOwnership
Value
<gnolang.StringValue>
base
string// "/r/\<name>/home"; every generated link starts with it
Value
"/r/g12yg9nh4ncma44emgm8msxe8aavzywt0p95tanv/home"
profile
home.profileData- OID
- 059edf…7885:93
profile details
badges
[]home.badge- OID
- 059edf…7885:94
badges details
now
home.nowLine- OID
- 059edf…7885:101
now details
tabs
[]string// tab order: home first, guestbook last
- OID
- 059edf…7885:102
tabs details
pages
map[string]string// markdown per tab
- OID
- 059edf…7885:103
pages details
waves
int// wave count; anyone can wave again
Value
0
entries
*v0.Tree// address -> \*entry
- OID
- 059edf…7885:104
entries details
order
*v0.Tree// zero-padded sequence -> address
- OID
- 059edf…7885:106
order details
posts
*v0.Tree// slug -> \*post
- OID
- 059edf…7885:108
posts details
postOrder
*v0.Tree// zero-padded sequence -> slug
- OID
- 059edf…7885:110
postOrder details
postSeq
int// last post sequence; never reused
Value
0
tips
home.tipStats- OID
- 059edf…7885:112
tips details
updated
int64// block height of the last owner write
Value
661744
init.53
func()- OID
- 059edf…7885:26
init.53 details
setDefaults
func()setDefaults writes the initial state (content.gno holds the personal part).
- OID
- 059edf…7885:28
setDefaults details
callerOf
func() .uverse.address- OID
- 059edf…7885:29
callerOf details
assertOwner
func()assertOwner is the owner guard.
- OID
- 059edf…7885:30
assertOwner details
Owner
func() .uverse.address- OID
- 059edf…7885:31
Owner details
Render
func(path string) stringRender shows one tab, or one post at blog/\<slug>. An unknown path shows Home and an unknown post shows Blog. The path is only compared against tab names or looked up as a slug, and never written into the page.
- OID
- 059edf…7885:32
Render details
frame
func(tab string, md string) stringframe puts the tab bar above a page and the footer below it.
- OID
- 059edf…7885:33
frame details
tabURL
func(t string) string- OID
- 059edf…7885:34
tabURL details
tabLabel
func(t string) stringtabLabel capitalizes a tab name; names are ASCII by validName.
- OID
- 059edf…7885:35
tabLabel details
tabBar
func(current string) stringtabBar draws every tab as a linked pill, the current one in brand green. The current tab is linked too, because gnoweb shows an unlinked image as a block and the row would break. Blog stays out until there is a post.
- OID
- 059edf…7885:36
tabBar details
footer
func() string- OID
- 059edf…7885:37
footer details
parsePage
func(query string) intparsePage reads page=N from the query; anything invalid is page 1.
- OID
- 059edf…7885:38
parsePage details
tipSuggestion
untyped stringSuggested amount on the Tip button (1 GNOT); visitors can change it.
Value
"1000000ugnot"
expand
func(md string, tab string, page int) stringexpand replaces every widget token in one pass. strings.Replacer does not rescan its output, so visitor text inside a widget can never trigger a token. Only the tokens present in md are built, found with a single scan of md.
- OID
- 059edf…7885:39
expand details
itoa
func(n int) string- OID
- 059edf…7885:41
itoa details
plural
func(n int, word string) stringplural renders "1 wave", "2 waves".
- OID
- 059edf…7885:42
plural details
svgImage
func(alt string, svg string) stringsvgImage embeds an SVG as a base64 data URI, the one inline image form gnoweb keeps.
- OID
- 059edf…7885:43
svgImage details
colBrand
untyped string// gnoweb's links and buttons
Value
"#226C57"
colDeep
untyped string// banner background, text on colSoft
Value
"#144134"
colAccent
untyped string// banner accents, pill outlines
Value
"#60AB96"
colSoft
untyped string// pale surface
Value
"#E7EFED"
colGhost
untyped stringgno.land's own greens, from gnoweb's palette. An image can't follow gnoweb's theme toggle, so each one reads on both its white and its near-black background.
Value
"#F0F0F0"
fontUI
untyped stringgno.land's own greens, from gnoweb's palette. An image can't follow gnoweb's theme toggle, so each one reads on both its white and its near-black background.
Value
"system-ui, -apple-system, Segoe UI, Helvetica, Arial, sans-serif"
bannerMD
func() string- OID
- 059edf…7885:44
bannerMD details
bannerSVG
func(height int64) stringbannerSVG draws the 720x160 banner: the ghost, a coffee cup, the name and the tagline. The face depends on height % 4: calm, happy, wink, surprised.
- OID
- 059edf…7885:45
bannerSVG details
fontSize
func(s string, size int, perChar int) stringfontSize shrinks size so text fits the 440 px between x=260 and the banner's right edge. perChar is the rough glyph width at that size; runes from U+1100 on (CJK, emoji and the like) count double. Scaling the font, rather than setting textLength, never stretches text that already fits.
- OID
- 059edf…7885:46
fontSize details
tabH
untyped bigintPills come in two heights: tabs, and chips (badges and buttons). gnoweb draws a 16 px icon on a linked image, 8 px from its left edge: images in a row get an 8 px margin, and the icon's center sits that far above the image's bottom edge. It lands on the center line of a chip about 16 px high, so chips are 17 px, with iconGap pixels left clear for it. External and $help links get the icon; tabs and the guestbook button link inside the realm's own namespace and don't.
Value
(26 <untyped> bigint)
chipH
untyped bigintPills come in two heights: tabs, and chips (badges and buttons). gnoweb draws a 16 px icon on a linked image, 8 px from its left edge: images in a row get an 8 px margin, and the icon's center sits that far above the image's bottom edge. It lands on the center line of a chip about 16 px high, so chips are 17 px, with iconGap pixels left clear for it. External and $help links get the icon; tabs and the guestbook button link inside the realm's own namespace and don't.
Value
(17 <untyped> bigint)
iconGap
untyped bigintPills come in two heights: tabs, and chips (badges and buttons). gnoweb draws a 16 px icon on a linked image, 8 px from its left edge: images in a row get an 8 px margin, and the icon's center sits that far above the image's bottom edge. It lands on the center line of a chip about 16 px high, so chips are 17 px, with iconGap pixels left clear for it. External and $help links get the icon; tabs and the guestbook button link inside the realm's own namespace and don't.
Value
(30 <untyped> bigint)
seg
typeseg is one colored part of a pill.
Value
home.seg
segOn
func(s string) home.seg- OID
- 059edf…7885:47
segOn details
segSoft
func(s string) home.seg- OID
- 059edf…7885:48
segSoft details
pillSVG
func(h int, gap int, segs []home.seg) stringpillSVG draws a pill h pixels high from segments, left to right, with gap empty pixels before the first text. SVG can't measure text before drawing, so widths come from the rune count, wide runes (U+1100 on) counting double. The outline gives the pale parts an edge on a white page.
- OID
- 059edf…7885:49
pillSVG details
half
func(n int) stringhalf writes n/2 with its .5, for SVG coordinates.
- OID
- 059edf…7885:50
half details
pillLink
func(alt string, url string, h int, gap int, segs []home.seg) stringpillLink is a pill image linked to url, with alt text for screen readers.
- OID
- 059edf…7885:51
pillLink details
badgesMD
func() stringbadgesMD draws the badges as one paragraph. A new row starts after a hard line break (a backslash ending the line), so rows sit as close as wrapped ones.
- OID
- 059edf…7885:52
badgesMD details
nowMD
func() string- OID
- 059edf…7885:53
nowMD details
button
func(action string, count string, url string, gap int) stringbutton is a linked chip: the action, then its count. $help links get gnoweb's transaction icon, hence the gap.
- OID
- 059edf…7885:54
button details
wavesMD
func() string- OID
- 059edf…7885:55
wavesMD details
tipMD
func() string- OID
- 059edf…7885:56
tipMD details
signMD
func() stringsignMD counts hidden entries too: their authors did sign.
- OID
- 059edf…7885:57
signMD details
shortAddr
func(a .uverse.address) stringshortAddr keeps the ends of an address: g1jg8mtu…sqf5.
- OID
- 059edf…7885:58
shortAddr details
userLink
func(a .uverse.address) stringuserLink links an address to its profile page under its short form. The address comes from the chain, never from visitor text.
- OID
- 059edf…7885:59
userLink details
clampPage
func(page int, total int) (int, int)clampPage returns the page to show, at most the last one, and the last page for total items.
- OID
- 059edf…7885:60
clampPage details
pageNav
func(tab string, page int, last int) stringpageNav links the pages around page on tab: Newer, then Older.
- OID
- 059edf…7885:61
pageNav details
signForm
untyped stringValue
"<gno-form exec=\"Sign\">\n <gno-input name=\"msg\" type=\"text\" placeholder=\"Say hi in 140 characters\" required=\"true\" />\n</gno-form>"
visitorText
func(msg string) stringvisitorText makes a stored message safe as one markdown list item. sanitize.InlineText escapes links, images, HTML and emphasis; the escaped @ and the g entity for the g of g1 keep gnoweb from turning "@name" or a typed g1 address into a profile link. Neither replacement produces the other's pattern, so the order doesn't matter.
- OID
- 059edf…7885:62
visitorText details
guestbookMD
func(page int) stringguestbookMD shows the form and one page of entries, newest first. Hidden entries still count toward the offset, so a page can show fewer than 20.
- OID
- 059edf…7885:63
guestbookMD details
postList
func(offset int, count int) stringpostList lists count posts from offset, newest first: one item each with the publish date as a code chip and the linked title.
- OID
- 059edf…7885:64
postList details
blogMD
func(page int) stringblogMD lists one page of posts.
- OID
- 059edf…7885:65
blogMD details
postsMD
func() stringpostsMD is the Latest posts section, or nothing while there are no posts, so no empty heading shows.
- OID
- 059edf…7885:66
postsMD details
postMD
func(p *home.post) stringpostMD is a post's page. The body is shown as written: no tokens.
- OID
- 059edf…7885:67
postMD details
maxSignBytes
untyped bigintValue
(560 <untyped> bigint)
invalid
func(field string) string- OID
- 059edf…7885:68
invalid details
checkLine
func(field string, s string, min int, max int)checkLine enforces valid UTF-8, a rune count in \[min, max], and no control characters (so no newline either): the text may end up inside an SVG, where they would break the XML.
- OID
- 059edf…7885:70
checkLine details
assertMasterKey
func()assertMasterKey refuses a transaction signed by a session key. Delegated keys may edit content, but not move ownership or hide an entry for good.
- OID
- 059edf…7885:71
assertMasterKey details
checkBadgeURL
func(u string)checkBadgeURL wants a printable-ASCII https:// URL (non-ASCII must be percent-encoded) with no quotes, backslashes, backticks, parentheses, square brackets, \< or >, so the markdown link can't end early or become javascript:.
- OID
- 059edf…7885:72
checkBadgeURL details
parseBadges
func(spec string) []home.badgeparseBadges reads one badge per line, "label | value | url". Blank lines between two badges start a new row; other blank lines are skipped.
- OID
- 059edf…7885:73
parseBadges details
hasVisible
func(s string) boolhasVisible reports whether s has a character that draws something: not a space, a format character (zero-width, bidi), a combining mark, or one of the blank-looking fillers (Hangul fillers, braille blank).
- OID
- 059edf…7885:74
hasVisible details
validName
func(s string, max int) boolvalidName wants 1 to max characters from a-z, 0-9 and "-": safe in a link, a tab label, and a path gnoweb passes to Render.
- OID
- 059edf…7885:75
validName details
checkPage
func(tab string, md string)checkPage enforces the tab name, the page size, and the tab count.
- OID
- 059edf…7885:76
checkPage details
checkPost
func(slug string, title string, body string)checkPost enforces the slug, a one-line title, and the body size. Title and body must each show something.
- OID
- 059edf…7885:77
checkPost details
seqKey
func(n int) stringseqKey zero-pads n so that keys sort in number order.
- OID
- 059edf…7885:78
seqKey details
touch
func()- OID
- 059edf…7885:79
touch details
SetNow
func(text string)SetNow sets the one-line status shown on Home; empty clears it.
- OID
- 059edf…7885:80
SetNow details
SetProfile
func(name string, tagline string)SetProfile sets the name and tagline drawn on the banner.
- OID
- 059edf…7885:81
SetProfile details
SetBadges
func(spec string)SetBadges replaces every badge. One badge per line: "label | value | url"; a blank line starts a new row.
- OID
- 059edf…7885:82
SetBadges details
SetPage
func(tab string, md string)SetPage creates or replaces any tab's markdown, Blog and Guestbook included. A new tab goes just before Guestbook, which stays last.
- OID
- 059edf…7885:83
SetPage details
RemovePage
func(tab string)RemovePage removes any tab except home, blog and guestbook.
- OID
- 059edf…7885:84
RemovePage details
SetPost
func(slug string, title string, body string)SetPost publishes a post, or edits the post at slug. An edit keeps the post's place in the list and its publish date.
- OID
- 059edf…7885:85
SetPost details
RemovePost
func(slug string)RemovePost deletes a post for good; its slug can be used again.
- OID
- 059edf…7885:86
RemovePost details
Hide
func(author .uverse.address)Hide hides an author's guestbook entry for good. The entry stays stored, so the author can't sign again, and nobody's deposit is refunded. Hiding a hidden entry does nothing.
- OID
- 059edf…7885:87
Hide details
TransferOwnership
func(newOwner .uverse.address)TransferOwnership records newOwner as pending; nothing changes until that address calls AcceptOwnership. Naming the current owner cancels.
- OID
- 059edf…7885:88
TransferOwnership details
AcceptOwnership
func()AcceptOwnership completes a transfer. Only the pending owner may call it, and a realm address can't pass the account guard, so it never can.
- OID
- 059edf…7885:89
AcceptOwnership details
Wave
func()Wave adds one to the wave count. It's a plain counter: anyone can wave again, and a wave stores nothing but the count.
- OID
- 059edf…7885:90
Wave details
Sign
func(msg string)Sign leaves one guestbook entry per address. The message is stored trimmed and sanitized when rendered, and must contain a visible character.
- OID
- 059edf…7885:91
Sign details
Tip
func()Tip forwards exactly the ugnot sent with this call to the owner. The account guard is inlined so the audit harness sees it next to OriginSend. It forwards what was sent, never the realm's balance: the OriginSend banker refuses to spend more than was sent.
- OID
- 059edf…7885:92