Skip to content Search Apps Documentation Source Content 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.

README.md

2.06 Kb · 53 lines

gno.land/p/moul/web25

Point a realm's on-chain page at the richer web2 frontend that also serves it, in one consistent line instead of a different hand-rolled banner per realm.

1var cfg web25.Config
2cfg.SetRemoteFrontendByURL("https://example.com/app")
3// or
4cfg.SetRemoteFrontendByCID("bafy...")   // resolved through an IPFS gateway
5
6func Render(path string) string {
7	return page() + cfg.Render(path)
8}

cfg.Render(path) appends DefaultText, with {link} replaced by the resolved URL:

Click here to visit the full rendering experience.

Set cfg.Text to use your own wording; {link} is the only placeholder. GetLink() returns the resolved URL if you want to place it yourself.

The opt-out is the point

Render emits nothing when the query carries ?no-web25=1 (the value matters: a bare ?no-web25 does not disable it). That matters because a realm's Render is also read by other realms and by tooling, and a "go look at our website instead" line is noise there. A caller that is not a browser appends ?no-web25=1 and gets the page without the pitch.

It also keeps the escape hatch visible: the web2 frontend is a convenience, and the chain-rendered page has to stand on its own. If it does not, the link is hiding a problem rather than solving one.

The name is the thesis: web2.5 is a web2 frontend over web3 state, and the chain page should say so rather than pretend the frontend does not exist.


Part of moul/gno-contracts — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.

Dependency graph:

gno.land/p/moul/web25/v0 dependency graph

⚠️ Disclaimer: provided as-is, without warranty; not security-audited. Full disclaimer: DISCLAIMER.