diff --git a/examples/docs/src/SocialMeta.elm b/examples/docs/src/SocialMeta.elm index 6a316e05..a7629666 100644 --- a/examples/docs/src/SocialMeta.elm +++ b/examples/docs/src/SocialMeta.elm @@ -29,6 +29,30 @@ summaryLarge details = |> tags +{-| +-} +app : + { title : String + , description : Maybe String + , siteUser : String + , image : Maybe { url : String, alt : String } + , appIdIphone : Maybe Int + , appIdIpad : Maybe Int + , appIdGooglePlay : Maybe String + , appUrlIphone : Maybe String + , appUrlIpad : Maybe String + , appUrlGooglePlay : Maybe String + , appCountry : Maybe String + , appNameIphone : Maybe String + , appNameIpad : Maybe String + , appNameGooglePlay : Maybe String + } + -> List Head.Tag +app details = + App details + |> tags + + ensureAtPrefix : String -> String ensureAtPrefix twitterUsername = if twitterUsername |> String.startsWith "@" then @@ -51,19 +75,21 @@ type TwitterCard , image : Maybe { url : String, alt : String } , size : SummarySize } - -- https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/app-card | App { title : String , description : Maybe String , siteUser : String , image : Maybe { url : String, alt : String } - , appIdIphone : Int - , appIdIpad : Int - , appIdGooglePlay : String + , appIdIphone : Maybe Int + , appIdIpad : Maybe Int + , appIdGooglePlay : Maybe String , appUrlIphone : Maybe String , appUrlIpad : Maybe String , appUrlGooglePlay : Maybe String , appCountry : Maybe String + , appNameIphone : Maybe String + , appNameIpad : Maybe String + , appNameGooglePlay : Maybe String } -- https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/player-card | Player @@ -95,6 +121,16 @@ tags card = , ( "twitter:description", details.description ) , ( "twitter:image", details.image |> Maybe.map .url ) , ( "twitter:image:alt", details.image |> Maybe.map .alt ) + , ( "twitter:app:name:iphone", details.appNameIphone ) + , ( "twitter:app:name:ipad", details.appNameIpad ) + , ( "twitter:app:name:googleplay", details.appNameGooglePlay ) + , ( "twitter:app:id:iphone", details.appIdIphone |> Maybe.map String.fromInt ) + , ( "twitter:app:id:ipad", details.appIdIpad |> Maybe.map String.fromInt ) + , ( "twitter:app:id:googleplay", details.appIdGooglePlay ) + , ( "twitter:app:url:iphone", details.appUrlIphone ) + , ( "twitter:app:url:ipad", details.appUrlIpad ) + , ( "twitter:app:url:googleplay", details.appUrlGooglePlay ) + , ( "twitter:app:country", details.appCountry ) ] Player details ->