mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2025-01-02 17:03:06 +03:00
Add profile helper for SEO for og:profile.
This commit is contained in:
parent
9853ed206f
commit
8dbe87d370
@ -2,6 +2,7 @@ module Head.Seo exposing
|
||||
( Image
|
||||
, article
|
||||
, audioPlayer
|
||||
, profile
|
||||
, song
|
||||
, summary
|
||||
, summaryLarge
|
||||
@ -221,6 +222,19 @@ book common details =
|
||||
Book details |> Content common |> tags
|
||||
|
||||
|
||||
{-| See <https://ogp.me/#type_profile>
|
||||
-}
|
||||
profile :
|
||||
{ firstName : String
|
||||
, lastName : String
|
||||
, username : Maybe String
|
||||
}
|
||||
-> Common pathKey
|
||||
-> List (Head.Tag pathKey)
|
||||
profile details common =
|
||||
Profile details |> Content common |> tags
|
||||
|
||||
|
||||
song :
|
||||
Common pathKey
|
||||
->
|
||||
@ -333,6 +347,11 @@ type ContentDetails
|
||||
, disc : Maybe Int
|
||||
, track : Maybe Int
|
||||
}
|
||||
| Profile
|
||||
{ firstName : String
|
||||
, lastName : String
|
||||
, username : Maybe String
|
||||
}
|
||||
|
||||
|
||||
{-| <https://en.wikipedia.org/wiki/ISO_8601>
|
||||
@ -425,6 +444,13 @@ tags (Content common details) =
|
||||
, ( "music:album:disc", songDetails.disc |> Maybe.map String.fromInt |> Maybe.map Head.raw )
|
||||
, ( "music:album:track", songDetails.track |> Maybe.map String.fromInt |> Maybe.map Head.raw )
|
||||
]
|
||||
|
||||
Profile profileDetails ->
|
||||
[ ( "og:type", "profile" |> Head.raw |> Just )
|
||||
, ( "profile:first_name", profileDetails.firstName |> Head.raw |> Just )
|
||||
, ( "profile:last_name", profileDetails.lastName |> Head.raw |> Just )
|
||||
, ( "profile:username", profileDetails.username |> Maybe.map Head.raw )
|
||||
]
|
||||
)
|
||||
|> List.filterMap
|
||||
(\( name, maybeContent ) ->
|
||||
|
@ -4,7 +4,6 @@ import Dict exposing (Dict)
|
||||
import Element exposing (Element)
|
||||
import Element.Font as Font
|
||||
import Mark
|
||||
import Pages.Parser
|
||||
|
||||
|
||||
type Metadata msg
|
||||
|
Loading…
Reference in New Issue
Block a user