PathrockNetwork Gno Explorer
HomeBlocksTransactionsRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/p/moul/web25/v0

Package
Open in gnoweb ↗

Overview

Kind
Pure package
Name
v0
Namespace
moul / web25
Files
3 (README)(gnomod.toml)
Exported functions
n/a — not supported for pure packages by the node (vm/qfuncs)
Module
gno.land/p/moul/web25/v0
gno
0.9

Files (3)

  • README.mdmarkdown
  • gnomod.tomltoml
  • web25.gnogno
web25.gnogno
1// Pacakge web25 provides an opinionated way to register an external web22// frontend to provide a "better" web2.5 experience.3package web2545import (6	"strings"78	"gno.land/p/moul/realmpath/v0"9)1011type Config struct {12	CID  string13	URL  string14	Text string15}1617func (c *Config) SetRemoteFrontendByURL(url string) {18	c.CID = ""19	c.URL = url20}2122func (c *Config) SetRemoteFrontendByCID(cid string) {23	c.CID = cid24	c.URL = ""25}2627func (c Config) GetLink() string {28	if c.CID != "" {29		return "https://ipfs.io/ipfs/" + c.CID30	}31	return c.URL32}3334const DefaultText = "Click [here]({link}) to visit the full rendering experience.\n"3536// Render displays a frontend link at the top of your realm's Render function in37// a concistent way to help gno visitors to have a consistent experience.38//39// if query is not nil, then it will check if it's not disable by ?no-web25, so40// that you can call the render function from an external point of view.41func (c Config) Render(path string) string {42	if realmpath.Parse(path).Query.Get("no-web25") == "1" {43		return ""44	}45	text := c.Text46	if text == "" {47		text = DefaultText48	}49	text = strings.ReplaceAll(text, "{link}", c.GetLink())50	return text51}52

Functions

not supported for pure packages by the node (vm/qfuncs)

Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.