From 82706dc277600f261341025820d37fc6b05d0acf Mon Sep 17 00:00:00 2001 From: Philemon Ukane Date: Fri, 31 Oct 2025 15:33:18 +0100 Subject: [PATCH] cmd/dcrdata: add network name to page title if not running mainnet Signed-off-by: Philemon Ukane --- cmd/dcrdata/internal/explorer/templates.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/dcrdata/internal/explorer/templates.go b/cmd/dcrdata/internal/explorer/templates.go index 2e2c7d49d..f0342b7af 100644 --- a/cmd/dcrdata/internal/explorer/templates.go +++ b/cmd/dcrdata/internal/explorer/templates.go @@ -327,6 +327,8 @@ func formattedDuration(duration time.Duration, str *periodMap) string { func makeTemplateFuncMap(params *chaincfg.Params) template.FuncMap { netTheme := "theme-" + strings.ToLower(netName(params)) + netName := netName(params) + notMainnet := netName != "Mainnet" return template.FuncMap{ "blockVoteBitsStr": func(voteBits uint16) string { @@ -632,6 +634,9 @@ func makeTemplateFuncMap(params *chaincfg.Params) template.FuncMap { }, "floor": math.Floor, "headData": func(data *CommonPageData, title string) headData { + if notMainnet { + title = fmt.Sprintf("%s - %s", title, netName) + } return headData{ Data: data, Title: title,