Skip to content

Commit

Permalink
feat(gnoweb): add gnoconnect html meta entries (gnolang#3609)
Browse files Browse the repository at this point in the history
Adds before the `</head>`:

```html
  <meta name="gnoconnect:rpc" content="127.0.0.1:26657" />
  <meta name="gnoconnect:chainid" content="dev" />
```

Blocks gnolang#3610

Signed-off-by: moul <[email protected]>
  • Loading branch information
moul authored Jan 27, 2025
1 parent f67f186 commit ad93c33
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gno.land/pkg/gnoweb/components/layout_index.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ type HeadData struct {
ChromaPath string
AssetsPath string
Analytics bool
Remote string
ChainId string
}

type IndexData struct {
Expand Down
4 changes: 4 additions & 0 deletions gno.land/pkg/gnoweb/components/layouts/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,9 @@

<!-- web assets -->
<link rel="stylesheet" href="{{ .AssetsPath }}styles.css" />

<!-- wallet integrations -->
<meta name="gnoconnect:rpc" content="{{ .Remote }}" />
<meta name="gnoconnect:chainid" content="{{ .ChainId }}" />
</head>
{{ end }}
2 changes: 2 additions & 0 deletions gno.land/pkg/gnoweb/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ func (h *WebHandler) Get(w http.ResponseWriter, r *http.Request) {
HeadData: components.HeadData{
AssetsPath: h.Static.AssetsPath,
ChromaPath: h.Static.ChromaPath,
ChainId: h.Static.ChainId,
Remote: h.Static.RemoteHelp,
},
FooterData: components.FooterData{
Analytics: h.Static.Analytics,
Expand Down

0 comments on commit ad93c33

Please sign in to comment.