go-frameproto/writeframeimage.go

23 lines
618 B
Go
Raw Permalink Normal View History

2024-02-13 18:21:48 +00:00
package frameproto
import (
"io"
)
// WriteFrameImage will write the HTML <meta/> element for the Frame-Protocol's (i.e., Farcaster Frame's) "fc:frame:image" name-value pair.
//
// For example, this call:
//
// var url string = "https://example.com/images/screen.png"
//
// frameproto.WriteFrameImage(writer, url)
//
// Would write this HTML <meta/> element:
//
// <meta property="fc:frame:image" content="https://example.com/images/screen.png" />
2024-02-15 17:43:14 +00:00
func WriteFrameImage(writer io.Writer, url string) error {
2024-02-13 18:21:48 +00:00
const property string = MetaPropertyFrameImage
2024-02-15 17:43:14 +00:00
return writeMetaPropertyContent(writer, property, url)
2024-02-13 18:21:48 +00:00
}