diff --git a/handlers/block.go b/handlers/block.go index 3d4fea31b6..af880f3626 100644 --- a/handlers/block.go +++ b/handlers/block.go @@ -49,7 +49,7 @@ func Block(w http.ResponseWriter, r *http.Request) { data := InitPageData(w, r, "blocks", "/blocks", "") if err != nil { - data.Meta.Title = fmt.Sprintf("%v - Slot %v - beaconcha.in - %v", utils.Config.Frontend.SiteName, slotOrHash, time.Now().Year()) + data.Meta.Title = fmt.Sprintf("%v - Slot %v - %v - %v", utils.Config.Frontend.SiteName, slotOrHash, utils.Config.Frontend.SiteDomain, time.Now().Year()) data.Meta.Path = "/block/" + slotOrHash logger.Errorf("error retrieving block data: %v", err) err = blockNotFoundTemplate.ExecuteTemplate(w, "layout", data) @@ -92,7 +92,7 @@ func Block(w http.ResponseWriter, r *http.Request) { blockSlot, blockRootHash) if err != nil { - data.Meta.Title = fmt.Sprintf("%v - Slot %v - beaconcha.in - %v", utils.Config.Frontend.SiteName, slotOrHash, time.Now().Year()) + data.Meta.Title = fmt.Sprintf("%v - Slot %v - %v - %v", utils.Config.Frontend.SiteName, slotOrHash, utils.Config.Frontend.SiteDomain, time.Now().Year()) data.Meta.Path = "/block/" + slotOrHash logger.Errorf("error retrieving block data: %v", err) err = blockNotFoundTemplate.ExecuteTemplate(w, "layout", data) @@ -105,7 +105,7 @@ func Block(w http.ResponseWriter, r *http.Request) { return } - data.Meta.Title = fmt.Sprintf("%v - Slot %v - beaconcha.in - %v", utils.Config.Frontend.SiteName, blockPageData.Slot, time.Now().Year()) + data.Meta.Title = fmt.Sprintf("%v - Slot %v - %v - %v", utils.Config.Frontend.SiteName, blockPageData.Slot, utils.Config.Frontend.SiteDomain, time.Now().Year()) data.Meta.Path = fmt.Sprintf("/block/%v", blockPageData.Slot) blockPageData.Ts = utils.SlotToTime(blockPageData.Slot) diff --git a/handlers/charts.go b/handlers/charts.go index bca6f9d6f6..04c8b4af9f 100644 --- a/handlers/charts.go +++ b/handlers/charts.go @@ -89,7 +89,7 @@ func GenericChart(w http.ResponseWriter, r *http.Request) { return } - data.Meta.Title = fmt.Sprintf("%v - %v Chart - beaconcha.in - %v", chartData.Title, utils.Config.Frontend.SiteName, time.Now().Year()) + data.Meta.Title = fmt.Sprintf("%v - %v Chart - %v - %v", chartData.Title, utils.Config.Frontend.SiteName, utils.Config.Frontend.SiteDomain, time.Now().Year()) data.Meta.Path = "/charts/" + chartVar data.Data = chartData diff --git a/handlers/epoch.go b/handlers/epoch.go index ba8acff4a3..8ec37eb624 100644 --- a/handlers/epoch.go +++ b/handlers/epoch.go @@ -30,7 +30,7 @@ func Epoch(w http.ResponseWriter, r *http.Request) { epoch, err := strconv.ParseUint(epochString, 10, 64) if err != nil { - data.Meta.Title = fmt.Sprintf("%v - Epoch %v - beaconcha.in - %v", utils.Config.Frontend.SiteName, epochString, time.Now().Year()) + data.Meta.Title = fmt.Sprintf("%v - Epoch %v - %v - %v", utils.Config.Frontend.SiteName, epochString, utils.Config.Frontend.SiteDomain, time.Now().Year()) data.Meta.Path = "/epoch/" + epochString logger.Errorf("error parsing epoch index %v: %v", epochString, err) err = epochNotFoundTemplate.ExecuteTemplate(w, "layout", data) @@ -43,7 +43,7 @@ func Epoch(w http.ResponseWriter, r *http.Request) { return } - data.Meta.Title = fmt.Sprintf("%v - Epoch %v - beaconcha.in - %v", utils.Config.Frontend.SiteName, epoch, time.Now().Year()) + data.Meta.Title = fmt.Sprintf("%v - Epoch %v - %v - %v", utils.Config.Frontend.SiteName, epoch, utils.Config.Frontend.SiteDomain, time.Now().Year()) data.Meta.Path = fmt.Sprintf("/epoch/%v", epoch) epochPageData := types.EpochPageData{} diff --git a/handlers/pageData.go b/handlers/pageData.go index 2237402129..152af7644b 100644 --- a/handlers/pageData.go +++ b/handlers/pageData.go @@ -19,12 +19,13 @@ func InitPageData(w http.ResponseWriter, r *http.Request, active, path, title st data := &types.PageData{ HeaderAd: false, Meta: &types.Meta{ - Title: fmt.Sprintf("%v - %v - beaconcha.in - %v", utils.Config.Frontend.SiteName, title, time.Now().Year()), + Title: fmt.Sprintf("%v - %v - %v - %v", utils.Config.Frontend.SiteName, title, utils.Config.Frontend.SiteDomain, time.Now().Year()), Description: "beaconcha.in makes the Ethereum 2.0. beacon chain accessible to non-technical end users", Path: path, GATag: utils.Config.Frontend.GATag, NoTrack: false, }, + SiteDomain: utils.Config.Frontend.SiteDomain, Active: active, Data: &types.Empty{}, User: getUser(w, r), diff --git a/handlers/validator.go b/handlers/validator.go index 5dcd1264a4..1b54f9f916 100644 --- a/handlers/validator.go +++ b/handlers/validator.go @@ -93,7 +93,7 @@ func Validator(w http.ResponseWriter, r *http.Request) { } validatorPageData.DepositsCount = uint64(len(deposits.Eth1Deposits)) if err != nil || len(deposits.Eth1Deposits) == 0 { - data.Meta.Title = fmt.Sprintf("%v - Validator %x - beaconcha.in - %v", utils.Config.Frontend.SiteName, pubKey, time.Now().Year()) + data.Meta.Title = fmt.Sprintf("%v - Validator %x - %v - %v", utils.Config.Frontend.SiteName, pubKey, utils.Config.Frontend.SiteDomain, time.Now().Year()) data.Meta.Path = fmt.Sprintf("/validator/%v", index) err := validatorNotFoundTemplate.ExecuteTemplate(w, "layout", data) if err != nil { @@ -206,7 +206,7 @@ func Validator(w http.ResponseWriter, r *http.Request) { // GetAvgOptimalInclusionDistance(index) - data.Meta.Title = fmt.Sprintf("%v - Validator %v - beaconcha.in - %v", utils.Config.Frontend.SiteName, index, time.Now().Year()) + data.Meta.Title = fmt.Sprintf("%v - Validator %v - %v - %v", utils.Config.Frontend.SiteName, index, utils.Config.Frontend.SiteDomain, time.Now().Year()) data.Meta.Path = fmt.Sprintf("/validator/%v", index) // logger.Infof("retrieving data, elapsed: %v", time.Since(start)) @@ -1324,7 +1324,7 @@ func ValidatorStatsTable(w http.ResponseWriter, r *http.Request) { } } - data.Meta.Title = fmt.Sprintf("%v - Daily Validator Statistics %v - beaconcha.in - %v", utils.Config.Frontend.SiteName, index, time.Now().Year()) + data.Meta.Title = fmt.Sprintf("%v - Daily Validator Statistics %v - %v - %v", utils.Config.Frontend.SiteName, index, utils.Config.Frontend.SiteDomain, time.Now().Year()) data.Meta.Path = fmt.Sprintf("/validator/%v/stats", index) validatorStatsTablePageData := &types.ValidatorStatsTablePageData{ diff --git a/services/notifications.go b/services/notifications.go index b79256dffc..f1ca523cfa 100644 --- a/services/notifications.go +++ b/services/notifications.go @@ -778,7 +778,7 @@ func (n *ethClientNotification) GetInfo(includeUrl bool) string { case "Lighthouse": url = "https://github.com/sigp/lighthouse/releases" default: - url = "https://beaconcha.in/ethClients" + url = fmt.Sprintf("https://%s/ethClients", utils.Config.Frontend.SiteDomain) } return generalPart + " " + url diff --git a/templates/layout.html b/templates/layout.html index 7cccb68f3e..e796b60804 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -367,7 +367,7 @@ - beaconcha.in + {{$.SiteDomain}}