2024-02-14 02:56:08 +00:00
|
|
|
package frameproto
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
)
|
|
|
|
|
|
|
|
// WriteFrame will write the HTML <meta/> element for the Frame-Protocol's (i.e., Farcaster Frame's) "fc:frame" name-value pair.
|
|
|
|
//
|
|
|
|
// For example, this call:
|
|
|
|
//
|
|
|
|
// var version string = "vNext"
|
|
|
|
//
|
2024-02-15 12:53:12 +00:00
|
|
|
// str := frameproto.WriteFrame(writer, version)
|
2024-02-14 02:56:08 +00:00
|
|
|
//
|
|
|
|
// Would write this HTML <meta/> element:
|
|
|
|
//
|
|
|
|
// <meta property="fc:frame" content="vNext" />
|
|
|
|
//
|
|
|
|
// Note that this package provides some constants to use with WriteFrame.
|
|
|
|
// Namely: VersionVNext (for "vNext").
|
|
|
|
//
|
|
|
|
// Which in code would be used as:
|
|
|
|
//
|
2024-02-15 12:53:12 +00:00
|
|
|
// str := frameproto.WriteFrame(writer, frameproto.VersionVNext)
|
2024-02-15 17:43:14 +00:00
|
|
|
func WriteFrame(writer io.Writer, version string) error {
|
2024-02-14 02:56:08 +00:00
|
|
|
const property string = MetaPropertyFrame
|
2024-02-15 17:43:14 +00:00
|
|
|
return writeMetaPropertyContent(writer, property, version)
|
2024-02-14 02:56:08 +00:00
|
|
|
}
|