Source File
social.go
Belonging Package
github.com/pancsta/go-app/pkg/app
package appimport// A Twitter card: https://developer.twitter.com/en/docs/twitter-for-websites/cardstype TwitterCard struct {// The card type, which will be one of “summary”, “summary_large_image”,// “app”, or “player”.Card string// Username for the website used in the card footer.Site string// Username for the content creator / author.Creator string// A concise title for the related content.Title string// A description that concisely summarizes the content as appropriate for// presentation within a Tweet.Description string// A URL to a unique image representing the content of the page.Image string// A text description of the image conveying the essential nature of an// image to users who are visually impaired. Maximum 420 characters.ImageAlt string}func ( TwitterCard) () map[string]string {:= make(map[string]string)if .Card != "" {["twitter:card"] = .Card}if .Site != "" {if !strings.HasPrefix(.Site, "@") {.Site = "@" + .Site}["twitter:site"] = .Site}if .Creator != "" {if !strings.HasPrefix(.Creator, "@") {.Creator = "@" + .Creator}["twitter:creator"] = .Creator}if .Title != "" {["twitter:title"] = .Title}if .Description != "" {["twitter:description"] = .Description}if .Image != "" {["twitter:image"] = .Image}if .ImageAlt != "" {["twitter:image:alt"] = .ImageAlt}return}
![]() |
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |