dillonkearns/elm-pages/4.0.0

NOTE: the latest version is 12.3.0

Head

This module contains low-level functions for building up values that will be rendered into the page's <head> tag when you run elm-pages build. Most likely the Head.Seo module will do everything you need out of the box, and you will just need to import Head so you can use the Tag type in your type annotations.

But this module might be useful if you have a special use case, or if you are writing a plugin package to extend elm-pages.

type Tag pathKey

Values that can be passed to the generated Pages.application config through the head function.

metaName : String -> AttributeValue pathKey -> Tag pathKey

Example:

metaName
    [ ( "name", "twitter:card" )
    , ( "content", "summary_large_image" )
    ]

Results in <meta name="twitter:card" content="summary_large_image" />

metaProperty : String -> AttributeValue pathKey -> Tag pathKey

Example:

Head.metaProperty "fb:app_id" (Head.raw "123456789")

Results in <meta property="fb:app_id" content="123456789" />

AttributeValues

type AttributeValue pathKey

Values, such as between the <>'s here:

<meta name="<THIS IS A VALUE>" content="<THIS IS A VALUE>" />

Create an AttributeValue representing the current page's full url.

Create an AttributeValue from an ImagePath.

fullPageUrl : PagePath pathKey -> AttributeValue pathKey

Create an AttributeValue from a PagePath.

raw : String -> AttributeValue pathKey

Create a raw AttributeValue (as opposed to some kind of absolute URL).

Functions for use by generated code

toJson : String -> String -> Tag pathKey -> Value

Feel free to use this, but in 99% of cases you won't need it. The generated code will run this for you to generate your manifest.json file automatically!