diff --git a/src/Head/Seo.elm b/src/Head/Seo.elm index 22208ed5..c99da598 100644 --- a/src/Head/Seo.elm +++ b/src/Head/Seo.elm @@ -3,6 +3,46 @@ module Head.Seo exposing (Common, Image, article, audioPlayer, profile, song, su {-| +This module encapsulates some of the best practices for SEO for your site. + +`elm-pages` will pre-render each of the static pages (in your `content` directory) so that +web crawlers can efficiently and accurately process it. The functions in this module are for use +with the `head` function that you pass to your Pages config (`Pages.application`). + + import Head + import Head.Seo as Seo + import Date -- justinmimbs/date package + + type alias ArticleMetadata = + { title : String + , description : String + , published : Date + , author : Data.Author.Author + } + + head : ArticleMetadata -> List (Head.Tag Pages.PathKey) + head articleMetadata = + Seo.summaryLarge + { canonicalUrlOverride = Nothing + , siteName = "elm-pages" + , image = + { url = Pages.images.icon + , alt = articleMetadata.description + , dimensions = Nothing + , mimeType = Nothing + } + , description = articleMetadata.description + , locale = Nothing + , title = articleMetadata.title + } + |> Seo.article + { tags = [] + , section = Nothing + , publishedTime = Just (Date.toIsoString articleMetadata.published) + , modifiedTime = Nothing + , expirationTime = Nothing + } + @docs Common, Image, article, audioPlayer, profile, song, summary, summaryLarge, videoPlayer, website -}