mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-29 14:56:36 +03:00
1 line
86 KiB
JSON
1 line
86 KiB
JSON
[{"name":"Head","comment":" This module contains low-level functions for building up\nvalues that will be rendered into the page's `<head>` tag\nwhen you run `elm-pages build`. Most likely the `Head.Seo` module\nwill do everything you need out of the box, and you will just need to import `Head`\nso you can use the `Tag` type in your type annotations.\n\nBut this module might be useful if you have a special use case, or if you are\nwriting a plugin package to extend `elm-pages`.\n\n@docs Tag, metaName, metaProperty\n@docs rssLink, sitemapLink\n\n\n## Structured Data\n\n@docs structuredData\n\n\n## `AttributeValue`s\n\n@docs AttributeValue\n@docs currentPageFullUrl, fullImageUrl, fullPageUrl, raw\n\n\n## Icons\n\n@docs appleTouchIcon, icon\n\n\n## Functions for use by generated code\n\n@docs toJson, canonicalLink\n\n","unions":[{"name":"AttributeValue","comment":" Values, such as between the `<>`'s here:\n\n```html\n<meta name=\"<THIS IS A VALUE>\" content=\"<THIS IS A VALUE>\" />\n```\n\n","args":["pathKey"],"cases":[]},{"name":"Tag","comment":" Values that can be passed to the generated `Pages.application` config\nthrough the `head` function.\n","args":["pathKey"],"cases":[]}],"aliases":[],"values":[{"name":"appleTouchIcon","comment":" Note: the type must be png.\nSee <https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html>.\n\nIf a size is provided, it will be turned into square dimensions as per the recommendations here: <https://developers.google.com/web/fundamentals/design-and-ux/browser-customization/#safari>\n\nImages must be png's, and non-transparent images are recommended. Current recommended dimensions are 180px and 192px.\n\n","type":"Maybe.Maybe Basics.Int -> Pages.ImagePath.ImagePath pathKey -> Head.Tag pathKey"},{"name":"canonicalLink","comment":" It's recommended that you use the `Seo` module helpers, which will provide this\nfor you, rather than directly using this.\n\nExample:\n\n Head.canonicalLink \"https://elm-pages.com\"\n\n","type":"Maybe.Maybe (Pages.PagePath.PagePath pathKey) -> Head.Tag pathKey"},{"name":"currentPageFullUrl","comment":" Create an `AttributeValue` representing the current page's full url.\n","type":"Head.AttributeValue pathKey"},{"name":"fullImageUrl","comment":" Create an `AttributeValue` from an `ImagePath`.\n","type":"Pages.ImagePath.ImagePath pathKey -> Head.AttributeValue pathKey"},{"name":"fullPageUrl","comment":" Create an `AttributeValue` from a `PagePath`.\n","type":"Pages.PagePath.PagePath pathKey -> Head.AttributeValue pathKey"},{"name":"icon","comment":" ","type":"List.List ( Basics.Int, Basics.Int ) -> MimeType.MimeImage -> Pages.ImagePath.ImagePath pathKey -> Head.Tag pathKey"},{"name":"metaName","comment":" Example:\n\n metaName\n [ ( \"name\", \"twitter:card\" )\n , ( \"content\", \"summary_large_image\" )\n ]\n\nResults in `<meta name=\"twitter:card\" content=\"summary_large_image\" />`\n\n","type":"String.String -> Head.AttributeValue pathKey -> Head.Tag pathKey"},{"name":"metaProperty","comment":" Example:\n\n Head.metaProperty \"fb:app_id\" (Head.raw \"123456789\")\n\nResults in `<meta property=\"fb:app_id\" content=\"123456789\" />`\n\n","type":"String.String -> Head.AttributeValue pathKey -> Head.Tag pathKey"},{"name":"raw","comment":" Create a raw `AttributeValue` (as opposed to some kind of absolute URL).\n","type":"String.String -> Head.AttributeValue pathKey"},{"name":"rssLink","comment":" Add a link to the site's RSS feed.\n\nExample:\n\n rssLink \"/feed.xml\"\n\n```html\n<link rel=\"alternate\" type=\"application/rss+xml\" href=\"/rss.xml\">\n```\n\n","type":"String.String -> Head.Tag pathKey"},{"name":"sitemapLink","comment":" Add a link to the site's RSS feed.\n\nExample:\n\n sitemapLink \"/feed.xml\"\n\n```html\n<link rel=\"sitemap\" type=\"application/xml\" href=\"/sitemap.xml\">\n```\n\n","type":"String.String -> Head.Tag pathKey"},{"name":"structuredData","comment":" You can learn more about structured data in [Google's intro to structured data](https://developers.google.com/search/docs/guides/intro-structured-data).\n\nWhen you add a `structuredData` item to one of your pages in `elm-pages`, it will add `json-ld` data to your document that looks like this:\n\n```html\n<script type=\"application/ld+json\">\n{\n \"@context\":\"http://schema.org/\",\n \"@type\":\"Article\",\n \"headline\":\"Extensible Markdown Parsing in Pure Elm\",\n \"description\":\"Introducing a new parser that extends your palette with no additional syntax\",\n \"image\":\"https://elm-pages.com/images/article-covers/extensible-markdown-parsing.jpg\",\n \"author\":{\n \"@type\":\"Person\",\n \"name\":\"Dillon Kearns\"\n },\n \"publisher\":{\n \"@type\":\"Person\",\n \"name\":\"Dillon Kearns\"\n },\n \"url\":\"https://elm-pages.com/blog/extensible-markdown-parsing-in-elm\",\n \"datePublished\":\"2019-10-08\",\n \"mainEntityOfPage\":{\n \"@type\":\"SoftwareSourceCode\",\n \"codeRepository\":\"https://github.com/dillonkearns/elm-pages\",\n \"description\":\"A statically typed site generator for Elm.\",\n \"author\":\"Dillon Kearns\",\n \"programmingLanguage\":{\n \"@type\":\"ComputerLanguage\",\n \"url\":\"http://elm-lang.org/\",\n \"name\":\"Elm\",\n \"image\":\"http://elm-lang.org/\",\n \"identifier\":\"http://elm-lang.org/\"\n }\n }\n}\n</script>\n```\n\nTo get that data, you would write this in your `elm-pages` head tags:\n\n import Json.Encode as Encode\n\n {-| <https://schema.org/Article>\n -}\n encodeArticle :\n { title : String\n , description : String\n , author : StructuredData { authorMemberOf | personOrOrganization : () } authorPossibleFields\n , publisher : StructuredData { publisherMemberOf | personOrOrganization : () } publisherPossibleFields\n , url : String\n , imageUrl : String\n , datePublished : String\n , mainEntityOfPage : Encode.Value\n }\n -> Head.Tag pathKey\n encodeArticle info =\n Encode.object\n [ ( \"@context\", Encode.string \"http://schema.org/\" )\n , ( \"@type\", Encode.string \"Article\" )\n , ( \"headline\", Encode.string info.title )\n , ( \"description\", Encode.string info.description )\n , ( \"image\", Encode.string info.imageUrl )\n , ( \"author\", encode info.author )\n , ( \"publisher\", encode info.publisher )\n , ( \"url\", Encode.string info.url )\n , ( \"datePublished\", Encode.string info.datePublished )\n , ( \"mainEntityOfPage\", info.mainEntityOfPage )\n ]\n |> Head.structuredData\n\nTake a look at this [Google Search Gallery](https://developers.google.com/search/docs/guides/search-gallery)\nto see some examples of how structured data can be used by search engines to give rich search results. It can help boost\nyour rankings, get better engagement for your content, and also make your content more accessible. For example,\nvoice assistant devices can make use of structured data. If you're hosting a conference and want to make the event\ndate and location easy for attendees to find, this can make that information more accessible.\n\nFor the current version of API, you'll need to make sure that the format is correct and contains the required and recommended\nstructure.\n\nCheck out <https://schema.org> for a comprehensive listing of possible data types and fields. And take a look at\nGoogle's [Structured Data Testing Tool](https://search.google.com/structured-data/testing-tool)\ntoo make sure that your structured data is valid and includes the recommended values.\n\nIn the future, `elm-pages` will likely support a typed API, but schema.org is a massive spec, and changes frequently.\nAnd there are multiple sources of information on the possible and recommended structure. So it will take some time\nfor the right API design to evolve. In the meantime, this allows you to make use of this for SEO purposes.\n\n","type":"Json.Encode.Value -> Head.Tag pathKey"},{"name":"toJson","comment":" Feel free to use this, but in 99% of cases you won't need it. The generated\ncode will run this for you to generate your `manifest.json` file automatically!\n","type":"String.String -> String.String -> Head.Tag pathKey -> Json.Encode.Value"}],"binops":[]},{"name":"Head.Seo","comment":" <https://ogp.me/#>\n<https://developers.facebook.com/docs/sharing/opengraph>\n\nThis module encapsulates some of the best practices for SEO for your site.\n\n`elm-pages` will pre-render each of the static pages (in your `content` directory) so that\nweb crawlers can efficiently and accurately process it. The functions in this module are for use\nwith the `head` function that you pass to your Pages config (`Pages.application`).\n\n import Date\n import Head\n import Head.Seo as Seo\n\n\n -- justinmimbs/date package\n type alias ArticleMetadata =\n { title : String\n , description : String\n , published : Date\n , author : Data.Author.Author\n }\n\n head : ArticleMetadata -> List (Head.Tag Pages.PathKey)\n head articleMetadata =\n Seo.summaryLarge\n { canonicalUrlOverride = Nothing\n , siteName = \"elm-pages\"\n , image =\n { url = Pages.images.icon\n , alt = articleMetadata.description\n , dimensions = Nothing\n , mimeType = Nothing\n }\n , description = articleMetadata.description\n , locale = Nothing\n , title = articleMetadata.title\n }\n |> Seo.article\n { tags = []\n , section = Nothing\n , publishedTime = Just (Date.toIsoString articleMetadata.published)\n , modifiedTime = Nothing\n , expirationTime = Nothing\n }\n\n@docs Common, Image, article, audioPlayer, profile, song, summary, summaryLarge, videoPlayer, website\n\n","unions":[],"aliases":[{"name":"Common","comment":" These fields apply to any type in the og object types\nSee <https://ogp.me/#metadata> and <https://ogp.me/#optional>\n\nSkipping this for now, if there's a use case I can add it in:\n\n - og:determiner - The word that appears before this object's title in a sentence. An enum of (a, an, the, \"\", auto). If auto is chosen, the consumer of your data should chose between \"a\" or \"an\". Default is \"\" (blank).\n\n","args":["pathKey"],"type":"{ title : String.String, image : Head.Seo.Image pathKey, canonicalUrlOverride : Maybe.Maybe (Pages.PagePath.PagePath pathKey), description : String.String, siteName : String.String, audio : Maybe.Maybe Head.Seo.Audio, video : Maybe.Maybe Head.Seo.Video, locale : Maybe.Maybe Head.Seo.Locale, alternateLocales : List.List Head.Seo.Locale, twitterCard : Head.Twitter.TwitterCard pathKey }"},{"name":"Image","comment":" See <https://ogp.me/#structured>\n","args":["pathKey"],"type":"{ url : Pages.ImagePath.ImagePath pathKey, alt : String.String, dimensions : Maybe.Maybe { width : Basics.Int, height : Basics.Int }, mimeType : Maybe.Maybe Head.Seo.MimeType }"}],"values":[{"name":"article","comment":" See <https://ogp.me/#type_article>\n","type":"{ tags : List.List String.String, section : Maybe.Maybe String.String, publishedTime : Maybe.Maybe Head.Seo.Iso8601DateTime, modifiedTime : Maybe.Maybe Head.Seo.Iso8601DateTime, expirationTime : Maybe.Maybe Head.Seo.Iso8601DateTime } -> Head.Seo.Common pathKey -> List.List (Head.Tag pathKey)"},{"name":"audioPlayer","comment":" Will be displayed as a Player card in twitter\nSee: <https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/player-card>\n\nOpenGraph audio will also be included.\nThe options will also be used to build up the appropriate OpenGraph `<meta>` tags.\n\n","type":"{ canonicalUrlOverride : Maybe.Maybe (Pages.PagePath.PagePath pathKey), siteName : String.String, image : Head.Seo.Image pathKey, description : String.String, title : String.String, audio : Head.Seo.Audio, locale : Maybe.Maybe Head.Seo.Locale } -> Head.Seo.Common pathKey"},{"name":"profile","comment":" See <https://ogp.me/#type_profile>\n","type":"{ firstName : String.String, lastName : String.String, username : Maybe.Maybe String.String } -> Head.Seo.Common pathKey -> List.List (Head.Tag pathKey)"},{"name":"song","comment":" See <https://ogp.me/#type_music.song>\n","type":"Head.Seo.Common pathKey -> { duration : Maybe.Maybe Basics.Int, album : Maybe.Maybe Basics.Int, disc : Maybe.Maybe Basics.Int, track : Maybe.Maybe Basics.Int } -> List.List (Head.Tag pathKey)"},{"name":"summary","comment":" Will be displayed as a large card in twitter\nSee: <https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/summary>\n\nThe options will also be used to build up the appropriate OpenGraph `<meta>` tags.\n\nNote: You cannot include audio or video tags with summaries.\nIf you want one of those, use `audioPlayer` or `videoPlayer`\n\n","type":"{ canonicalUrlOverride : Maybe.Maybe (Pages.PagePath.PagePath pathKey), siteName : String.String, image : Head.Seo.Image pathKey, description : String.String, title : String.String, locale : Maybe.Maybe Head.Seo.Locale } -> Head.Seo.Common pathKey"},{"name":"summaryLarge","comment":" Will be displayed as a large card in twitter\nSee: <https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/summary-card-with-large-image>\n\nThe options will also be used to build up the appropriate OpenGraph `<meta>` tags.\n\nNote: You cannot include audio or video tags with summaries.\nIf you want one of those, use `audioPlayer` or `videoPlayer`\n\n","type":"{ canonicalUrlOverride : Maybe.Maybe (Pages.PagePath.PagePath pathKey), siteName : String.String, image : Head.Seo.Image pathKey, description : String.String, title : String.String, locale : Maybe.Maybe Head.Seo.Locale } -> Head.Seo.Common pathKey"},{"name":"videoPlayer","comment":" Will be displayed as a Player card in twitter\nSee: <https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/player-card>\n\nOpenGraph video will also be included.\nThe options will also be used to build up the appropriate OpenGraph `<meta>` tags.\n\n","type":"{ canonicalUrlOverride : Maybe.Maybe (Pages.PagePath.PagePath pathKey), siteName : String.String, image : Head.Seo.Image pathKey, description : String.String, title : String.String, video : Head.Seo.Video, locale : Maybe.Maybe Head.Seo.Locale } -> Head.Seo.Common pathKey"},{"name":"website","comment":" <https://ogp.me/#type_website>\n","type":"Head.Seo.Common pathKey -> List.List (Head.Tag pathKey)"}],"binops":[]},{"name":"OptimizedDecoder","comment":" This module allows you to build decoders that `elm-pages` can optimize for you in your `StaticHttp` requests.\nIt does this by stripping of unused fields during the CLI build step. When it runs in production, it will\njust run a plain `elm/json` decoder, so you're fetching and decoding the stripped-down data, but without any\nperformance penalty.\n\nFor convenience, this library also includes a `Json.Decode.Exploration.Pipeline`\nmodule which is largely a copy of [`NoRedInk/elm-decode-pipeline`][edp].\n\n[edp]: http://package.elm-lang.org/packages/NoRedInk/elm-decode-pipeline/latest\n\n\n## Dealing with warnings and errors\n\n@docs Error, errorToString\n\n\n# Primitives\n\n@docs Decoder, string, bool, int, float, Value\n\n\n# Data Structures\n\n@docs nullable, list, array, dict, keyValuePairs\n\n\n# Object Primitives\n\n@docs field, at, index\n\n\n# Inconsistent Structure\n\n@docs maybe, oneOf\n\n\n# Fancy Decoding\n\n@docs lazy, value, null, succeed, fail, andThen\n\n\n# Mapping\n\n**Note:** If you run out of map functions, take a look at [the pipeline module][pipe]\nwhich makes it easier to handle large objects.\n\n[pipe]: http://package.elm-lang.org/packages/zwilias/json-decode-exploration/latest/Json-Decode-Exploration-Pipeline\n\n@docs map, map2, map3, map4, map5, map6, map7, map8, andMap\n\n\n# Directly Running Decoders\n\nUsually you'll be passing your decoders to\n\n@docs decodeString, decodeValue, decoder\n\n","unions":[],"aliases":[{"name":"Decoder","comment":" A decoder that will be optimized in your production bundle.\n","args":["a"],"type":"Internal.OptimizedDecoder.OptimizedDecoder a"},{"name":"Error","comment":" A simple type alias for `Json.Decode.Error`.\n","args":[],"type":"Json.Decode.Error"},{"name":"Value","comment":" A simple type alias for `Json.Decode.Value`.\n","args":[],"type":"Json.Decode.Value"}],"values":[{"name":"andMap","comment":" Decode an argument and provide it to a function in a decoder.\n\n decoder : Decoder String\n decoder =\n succeed (String.repeat)\n |> andMap (field \"count\" int)\n |> andMap (field \"val\" string)\n\n\n \"\"\" { \"val\": \"hi\", \"count\": 3 } \"\"\"\n |> decodeString decoder\n --> Success \"hihihi\"\n\n","type":"OptimizedDecoder.Decoder a -> OptimizedDecoder.Decoder (a -> b) -> OptimizedDecoder.Decoder b"},{"name":"andThen","comment":" Chain decoders where one decoder depends on the value of another decoder.\n","type":"(a -> OptimizedDecoder.Decoder b) -> OptimizedDecoder.Decoder a -> OptimizedDecoder.Decoder b"},{"name":"array","comment":" _Convenience function._ Decode a JSON array into an Elm `Array`.\n\n import Array\n\n \"\"\" [ 1, 2, 3 ] \"\"\"\n |> decodeString (array int)\n --> Success <| Array.fromList [ 1, 2, 3 ]\n\n","type":"OptimizedDecoder.Decoder a -> OptimizedDecoder.Decoder (Array.Array a)"},{"name":"at","comment":" Decodes a value at a certain path, using a provided decoder. Essentially,\nwriting `at [ \"a\", \"b\", \"c\" ] string` is sugar over writing\n`field \"a\" (field \"b\" (field \"c\" string))`}.\n\n \"\"\" { \"a\": { \"b\": { \"c\": \"hi there\" } } } \"\"\"\n |> decodeString (at [ \"a\", \"b\", \"c\" ] string)\n --> Success \"hi there\"\n\n","type":"List.List String.String -> OptimizedDecoder.Decoder a -> OptimizedDecoder.Decoder a"},{"name":"bool","comment":" Decode a boolean value.\n\n \"\"\" [ true, false ] \"\"\"\n |> decodeString (list bool)\n --> Success [ True, False ]\n\n","type":"OptimizedDecoder.Decoder Basics.Bool"},{"name":"decodeString","comment":" A simple wrapper for `Json.Decode.errorToString`.\n\nThis will directly call the raw `elm/json` decoder that is stored under the hood.\n\n","type":"OptimizedDecoder.Decoder a -> String.String -> Result.Result OptimizedDecoder.Error a"},{"name":"decodeValue","comment":" A simple wrapper for `Json.Decode.errorToString`.\n\nThis will directly call the raw `elm/json` decoder that is stored under the hood.\n\n","type":"OptimizedDecoder.Decoder a -> OptimizedDecoder.Value -> Result.Result OptimizedDecoder.Error a"},{"name":"decoder","comment":" Usually you'll want to directly pass your `OptimizedDecoder` to `StaticHttp` or other `elm-pages` APIs.\nBut if you want to re-use your decoder somewhere else, it may be useful to turn it into a plain `elm/json` decoder.\n","type":"OptimizedDecoder.Decoder a -> Json.Decode.Decoder a"},{"name":"dict","comment":" _Convenience function._ Decode a JSON object into an Elm `Dict String`.\n\n import Dict\n\n\n \"\"\" { \"foo\": \"bar\", \"bar\": \"hi there\" } \"\"\"\n |> decodeString (dict string)\n --> Success <| Dict.fromList\n --> [ ( \"bar\", \"hi there\" )\n --> , ( \"foo\", \"bar\" )\n --> ]\n\n","type":"OptimizedDecoder.Decoder v -> OptimizedDecoder.Decoder (Dict.Dict String.String v)"},{"name":"errorToString","comment":" A simple wrapper for `Json.Decode.errorToString`.\n","type":"Json.Decode.Error -> String.String"},{"name":"fail","comment":" Ignore the json and fail with a provided message.\n\n import List.Nonempty exposing (Nonempty(..))\n import Json.Decode.Exploration.Located exposing (Located(..))\n import Json.Encode as Encode\n\n \"\"\" \"hello\" \"\"\"\n |> decodeString (fail \"failure\")\n --> Errors (Nonempty (Here <| Failure \"failure\" (Just <| Encode.string \"hello\")) [])\n\n","type":"String.String -> OptimizedDecoder.Decoder a"},{"name":"field","comment":" Decode the content of a field using a provided decoder.\n\n import List.Nonempty as Nonempty\n import Json.Decode.Exploration.Located exposing (Located(..))\n import Json.Encode as Encode\n\n \"\"\" { \"foo\": \"bar\" } \"\"\"\n |> decodeString (field \"foo\" string)\n --> Success \"bar\"\n\n\n \"\"\" [ { \"foo\": \"bar\" }, { \"foo\": \"baz\", \"hello\": \"world\" } ] \"\"\"\n |> decodeString (list (field \"foo\" string))\n --> WithWarnings expectedWarnings [ \"bar\", \"baz\" ]\n\n\n expectedWarnings : Warnings\n expectedWarnings =\n UnusedField \"hello\"\n |> Here\n |> Nonempty.fromElement\n |> AtIndex 1\n |> Nonempty.fromElement\n\n","type":"String.String -> OptimizedDecoder.Decoder a -> OptimizedDecoder.Decoder a"},{"name":"float","comment":" Decode a number into a `Float`.\n\n import List.Nonempty exposing (Nonempty(..))\n import Json.Decode.Exploration.Located exposing (Located(..))\n import Json.Encode as Encode\n\n\n \"\"\" 12.34 \"\"\"\n |> decodeString float\n --> Success 12.34\n\n\n \"\"\" 12 \"\"\"\n |> decodeString float\n --> Success 12\n\n\n \"\"\" null \"\"\"\n |> decodeString float\n --> Errors (Nonempty (Here <| Expected TNumber Encode.null) [])\n\n","type":"OptimizedDecoder.Decoder Basics.Float"},{"name":"index","comment":" Decode a specific index using a specified `Decoder`.\n\n import List.Nonempty exposing (Nonempty(..))\n import Json.Decode.Exploration.Located exposing (Located(..))\n import Json.Encode as Encode\n\n\n \"\"\" [ \"hello\", 123 ] \"\"\"\n |> decodeString (map2 Tuple.pair (index 0 string) (index 1 int))\n --> Success ( \"hello\", 123 )\n\n\n \"\"\" [ \"hello\", \"there\" ] \"\"\"\n |> decodeString (index 1 string)\n --> WithWarnings (Nonempty (AtIndex 0 (Nonempty (Here (UnusedValue (Encode.string \"hello\"))) [])) [])\n --> \"there\"\n\n","type":"Basics.Int -> OptimizedDecoder.Decoder a -> OptimizedDecoder.Decoder a"},{"name":"int","comment":" Decode a number into an `Int`.\n\n import List.Nonempty exposing (Nonempty(..))\n import Json.Decode.Exploration.Located exposing (Located(..))\n import Json.Encode as Encode\n\n\n \"\"\" 123 \"\"\"\n |> decodeString int\n --> Success 123\n\n\n \"\"\" 0.1 \"\"\"\n |> decodeString int\n --> Errors <|\n --> Nonempty\n --> (Here <| Expected TInt (Encode.float 0.1))\n --> []\n\n","type":"OptimizedDecoder.Decoder Basics.Int"},{"name":"keyValuePairs","comment":" Decode a JSON object into a list of key-value pairs. The decoder you provide\nwill be used to decode the values.\n\n \"\"\" { \"foo\": \"bar\", \"hello\": \"world\" } \"\"\"\n |> decodeString (keyValuePairs string)\n --> Success [ ( \"foo\", \"bar\" ), ( \"hello\", \"world\" ) ]\n\n","type":"OptimizedDecoder.Decoder a -> OptimizedDecoder.Decoder (List.List ( String.String, a ))"},{"name":"lazy","comment":" Required when using (mutually) recursive decoders.\n","type":"(() -> OptimizedDecoder.Decoder a) -> OptimizedDecoder.Decoder a"},{"name":"list","comment":" Decode a list of values, decoding each entry with the provided decoder.\n\n import List.Nonempty exposing (Nonempty(..))\n import Json.Decode.Exploration.Located exposing (Located(..))\n import Json.Encode as Encode\n\n\n \"\"\" [ \"foo\", \"bar\" ] \"\"\"\n |> decodeString (list string)\n --> Success [ \"foo\", \"bar\" ]\n\n\n \"\"\" [ \"foo\", null ] \"\"\"\n |> decodeString (list string)\n --> Errors <|\n --> Nonempty\n --> (AtIndex 1 <|\n --> Nonempty (Here <| Expected TString Encode.null) []\n --> )\n --> []\n\n","type":"OptimizedDecoder.Decoder a -> OptimizedDecoder.Decoder (List.List a)"},{"name":"map","comment":" Useful for transforming decoders.\n\n \"\"\" \"foo\" \"\"\"\n |> decodeString (map String.toUpper string)\n --> Success \"FOO\"\n\n","type":"(a -> b) -> OptimizedDecoder.Decoder a -> OptimizedDecoder.Decoder b"},{"name":"map2","comment":" Combine 2 decoders.\n","type":"(a -> b -> c) -> OptimizedDecoder.Decoder a -> OptimizedDecoder.Decoder b -> OptimizedDecoder.Decoder c"},{"name":"map3","comment":" Combine 3 decoders.\n","type":"(a -> b -> c -> d) -> OptimizedDecoder.Decoder a -> OptimizedDecoder.Decoder b -> OptimizedDecoder.Decoder c -> OptimizedDecoder.Decoder d"},{"name":"map4","comment":" Combine 4 decoders.\n","type":"(a -> b -> c -> d -> e) -> OptimizedDecoder.Decoder a -> OptimizedDecoder.Decoder b -> OptimizedDecoder.Decoder c -> OptimizedDecoder.Decoder d -> OptimizedDecoder.Decoder e"},{"name":"map5","comment":" Combine 5 decoders.\n","type":"(a -> b -> c -> d -> e -> f) -> OptimizedDecoder.Decoder a -> OptimizedDecoder.Decoder b -> OptimizedDecoder.Decoder c -> OptimizedDecoder.Decoder d -> OptimizedDecoder.Decoder e -> OptimizedDecoder.Decoder f"},{"name":"map6","comment":" Combine 6 decoders.\n","type":"(a -> b -> c -> d -> e -> f -> g) -> OptimizedDecoder.Decoder a -> OptimizedDecoder.Decoder b -> OptimizedDecoder.Decoder c -> OptimizedDecoder.Decoder d -> OptimizedDecoder.Decoder e -> OptimizedDecoder.Decoder f -> OptimizedDecoder.Decoder g"},{"name":"map7","comment":" Combine 7 decoders.\n","type":"(a -> b -> c -> d -> e -> f -> g -> h) -> OptimizedDecoder.Decoder a -> OptimizedDecoder.Decoder b -> OptimizedDecoder.Decoder c -> OptimizedDecoder.Decoder d -> OptimizedDecoder.Decoder e -> OptimizedDecoder.Decoder f -> OptimizedDecoder.Decoder g -> OptimizedDecoder.Decoder h"},{"name":"map8","comment":" Combine 8 decoders.\n","type":"(a -> b -> c -> d -> e -> f -> g -> h -> i) -> OptimizedDecoder.Decoder a -> OptimizedDecoder.Decoder b -> OptimizedDecoder.Decoder c -> OptimizedDecoder.Decoder d -> OptimizedDecoder.Decoder e -> OptimizedDecoder.Decoder f -> OptimizedDecoder.Decoder g -> OptimizedDecoder.Decoder h -> OptimizedDecoder.Decoder i"},{"name":"maybe","comment":" Decodes successfully and wraps with a `Just`, handling failure by succeeding\nwith `Nothing`.\n\n import List.Nonempty as Nonempty\n import Json.Decode.Exploration.Located exposing (Located(..))\n import Json.Encode as Encode\n\n\n \"\"\" [ \"foo\", 12 ] \"\"\"\n |> decodeString (list <| maybe string)\n --> WithWarnings expectedWarnings [ Just \"foo\", Nothing ]\n\n\n expectedWarnings : Warnings\n expectedWarnings =\n UnusedValue (Encode.int 12)\n |> Here\n |> Nonempty.fromElement\n |> AtIndex 1\n |> Nonempty.fromElement\n\n","type":"OptimizedDecoder.Decoder a -> OptimizedDecoder.Decoder (Maybe.Maybe a)"},{"name":"null","comment":" Decode a `null` and succeed with some value.\n\n \"\"\" null \"\"\"\n |> decodeString (null \"it was null\")\n --> Success \"it was null\"\n\nNote that `undefined` and `null` are not the same thing. This cannot be used to\nverify that a field is _missing_, only that it is explicitly set to `null`.\n\n \"\"\" { \"foo\": null } \"\"\"\n |> decodeString (field \"foo\" (null ()))\n --> Success ()\n\n\n import List.Nonempty exposing (Nonempty(..))\n import Json.Decode.Exploration.Located exposing (Located(..))\n import Json.Encode as Encode\n\n\n \"\"\" { } \"\"\"\n |> decodeString (field \"foo\" (null ()))\n --> Errors <|\n --> Nonempty\n --> (Here <| Expected (TObjectField \"foo\") (Encode.object []))\n --> []\n\n","type":"a -> OptimizedDecoder.Decoder a"},{"name":"nullable","comment":" Decodes successfully and wraps with a `Just`. If the values is `null`\nsucceeds with `Nothing`.\n\n \"\"\" [ { \"foo\": \"bar\" }, { \"foo\": null } ] \"\"\"\n |> decodeString (list <| field \"foo\" <| nullable string)\n --> Success [ Just \"bar\", Nothing ]\n\n","type":"OptimizedDecoder.Decoder a -> OptimizedDecoder.Decoder (Maybe.Maybe a)"},{"name":"oneOf","comment":" Tries a bunch of decoders. The first one to not fail will be the one used.\n\nIf all fail, the errors are collected into a `BadOneOf`.\n\n import List.Nonempty as Nonempty\n import Json.Decode.Exploration.Located exposing (Located(..))\n import Json.Encode as Encode\n\n \"\"\" [ 12, \"whatever\" ] \"\"\"\n |> decodeString (list <| oneOf [ map String.fromInt int, string ])\n --> Success [ \"12\", \"whatever\" ]\n\n\n \"\"\" null \"\"\"\n |> decodeString (oneOf [ string, map String.fromInt int ])\n --> Errors <| Nonempty.fromElement <| Here <| BadOneOf\n --> [ Nonempty.fromElement <| Here <| Expected TString Encode.null\n --> , Nonempty.fromElement <| Here <| Expected TInt Encode.null\n --> ]\n\n","type":"List.List (OptimizedDecoder.Decoder a) -> OptimizedDecoder.Decoder a"},{"name":"string","comment":" Decode a string.\n\n import List.Nonempty exposing (Nonempty(..))\n import Json.Decode.Exploration.Located exposing (Located(..))\n import Json.Encode as Encode\n\n\n \"\"\" \"hello world\" \"\"\"\n |> decodeString string\n --> Success \"hello world\"\n\n\n \"\"\" 123 \"\"\"\n |> decodeString string\n --> Errors (Nonempty (Here <| Expected TString (Encode.int 123)) [])\n\n","type":"OptimizedDecoder.Decoder String.String"},{"name":"succeed","comment":" A decoder that will ignore the actual JSON and succeed with the provided\nvalue. Note that this may still fail when dealing with an invalid JSON string.\n\nIf a value in the JSON ends up being ignored because of this, this will cause a\nwarning.\n\n import List.Nonempty exposing (Nonempty(..))\n import Json.Decode.Exploration.Located exposing (Located(..))\n import Json.Encode as Encode\n\n\n \"\"\" null \"\"\"\n |> decodeString (value |> andThen (\\_ -> succeed \"hello world\"))\n --> Success \"hello world\"\n\n\n \"\"\" null \"\"\"\n |> decodeString (succeed \"hello world\")\n --> WithWarnings\n --> (Nonempty (Here <| UnusedValue Encode.null) [])\n --> \"hello world\"\n\n\n \"\"\" foo \"\"\"\n |> decodeString (succeed \"hello world\")\n --> BadJson\n\n","type":"a -> OptimizedDecoder.Decoder a"},{"name":"value","comment":" Extract a piece without actually decoding it.\n\nIf a structure is decoded as a `value`, everything _in_ the structure will be\nconsidered as having been used and will not appear in `UnusedValue` warnings.\n\n import Json.Encode as Encode\n\n\n \"\"\" [ 123, \"world\" ] \"\"\"\n |> decodeString value\n --> Success (Encode.list identity [ Encode.int 123, Encode.string \"world\" ])\n\n","type":"OptimizedDecoder.Decoder OptimizedDecoder.Value"}],"binops":[]},{"name":"OptimizedDecoder.Pipeline","comment":"\n\n\n# Json.Decode.Pipeline\n\nUse the `(|>)` operator to build JSON decoders.\n\n\n## Decoding fields\n\n@docs required, requiredAt, optional, optionalAt, hardcoded, custom\n\n\n## Beginning and ending pipelines\n\n@docs decode, resolve\n\n\n### Verified docs\n\nThe examples all expect imports set up like this:\n\n import Json.Decode.Exploration exposing (..)\n import Json.Decode.Exploration.Pipeline exposing (..)\n import Json.Decode.Exploration.Located exposing (Located(..))\n import Json.Encode as Encode\n import List.Nonempty as Nonempty\n\nFor automated verification of these examples, this import is also required.\nPlease ignore it.\n\n import DocVerificationHelpers exposing (User)\n\n","unions":[],"aliases":[],"values":[{"name":"custom","comment":" Run the given decoder and feed its result into the pipeline at this point.\n\nConsider this example.\n\n import Json.Decode.Exploration exposing (..)\n\n\n type alias User =\n { id : Int\n , name : String\n , email : String\n }\n\n userDecoder : Decoder User\n userDecoder =\n decode User\n |> required \"id\" int\n |> custom (at [ \"profile\", \"name\" ] string)\n |> required \"email\" string\n\n \"\"\"\n {\n \"id\": 123,\n \"email\": \"sam@example.com\",\n \"profile\": {\"name\": \"Sam\"}\n }\n \"\"\"\n |> decodeString userDecoder\n --> Success { id = 123, name = \"Sam\", email = \"sam@example.com\" }\n\n","type":"OptimizedDecoder.Decoder a -> OptimizedDecoder.Decoder (a -> b) -> OptimizedDecoder.Decoder b"},{"name":"decode","comment":" Begin a decoding pipeline. This is a synonym for [Json.Decode.succeed](http://package.elm-lang.org/packages/elm-lang/core/latest/Json-Decode#succeed),\nintended to make things read more clearly.\n\n type alias User =\n { id : Int\n , email : String\n , name : String\n }\n\n userDecoder : Decoder User\n userDecoder =\n decode User\n |> required \"id\" int\n |> required \"email\" string\n |> optional \"name\" string \"\"\n\n","type":"a -> OptimizedDecoder.Decoder a"},{"name":"hardcoded","comment":" Rather than decoding anything, use a fixed value for the next step in the\npipeline. `harcoded` does not look at the JSON at all.\n\n import Json.Decode.Exploration exposing (..)\n\n\n type alias User =\n { id : Int\n , name : String\n , email : String\n }\n\n userDecoder : Decoder User\n userDecoder =\n decode User\n |> required \"id\" int\n |> hardcoded \"Alex\"\n |> required \"email\" string\n\n \"\"\" { \"id\": 123, \"email\": \"sam@example.com\" } \"\"\"\n |> decodeString userDecoder\n --> Success { id = 123, name = \"Alex\", email = \"sam@example.com\" }\n\n","type":"a -> OptimizedDecoder.Decoder (a -> b) -> OptimizedDecoder.Decoder b"},{"name":"optional","comment":" Decode a field that may be missing or have a null value. If the field is\nmissing, then it decodes as the `fallback` value. If the field is present,\nthen `valDecoder` is used to decode its value. If `valDecoder` fails on a\n`null` value, then the `fallback` is used as if the field were missing\nentirely.\n\n import Json.Decode.Exploration exposing (..)\n\n type alias User =\n { id : Int\n , name : String\n , email : String\n }\n\n userDecoder : Decoder User\n userDecoder =\n decode User\n |> required \"id\" int\n |> optional \"name\" string \"blah\"\n |> required \"email\" string\n\n \"\"\" { \"id\": 123, \"email\": \"sam@example.com\" } \"\"\"\n |> decodeString userDecoder\n --> Success { id = 123, name = \"blah\", email = \"sam@example.com\" }\n\nBecause `valDecoder` is given an opportunity to decode `null` values before\nresorting to the `fallback`, you can distinguish between missing and `null`\nvalues if you need to:\n\n userDecoder2 =\n decode User\n |> required \"id\" int\n |> optional \"name\" (oneOf [ string, null \"NULL\" ]) \"MISSING\"\n |> required \"email\" string\n\nNote also that this behaves _slightly_ different than the stock pipeline\npackage.\n\nIn the stock pipeline package, running the following decoder with an array as\nthe input would _succeed_.\n\n fooDecoder =\n decode identity\n |> optional \"foo\" (maybe string) Nothing\n\nIn this package, such a decoder will error out instead, saying that it expected\nthe input to be an object. The _key_ `\"foo\"` is optional, but it really does\nhave to be an object before we even consider trying your decoder or returning\nthe fallback.\n\n","type":"String.String -> OptimizedDecoder.Decoder a -> a -> OptimizedDecoder.Decoder (a -> b) -> OptimizedDecoder.Decoder b"},{"name":"optionalAt","comment":" Decode an optional nested field.\n","type":"List.List String.String -> OptimizedDecoder.Decoder a -> a -> OptimizedDecoder.Decoder (a -> b) -> OptimizedDecoder.Decoder b"},{"name":"required","comment":" Decode a required field.\n\n import Json.Decode.Exploration exposing (..)\n\n type alias User =\n { id : Int\n , name : String\n , email : String\n }\n\n userDecoder : Decoder User\n userDecoder =\n decode User\n |> required \"id\" int\n |> required \"name\" string\n |> required \"email\" string\n\n \"\"\" {\"id\": 123, \"email\": \"sam@example.com\", \"name\": \"Sam\"} \"\"\"\n |> decodeString userDecoder\n --> Success { id = 123, name = \"Sam\", email = \"sam@example.com\" }\n\n","type":"String.String -> OptimizedDecoder.Decoder a -> OptimizedDecoder.Decoder (a -> b) -> OptimizedDecoder.Decoder b"},{"name":"requiredAt","comment":" Decode a required nested field.\n\n import Json.Decode.Exploration exposing (..)\n\n type alias User =\n { id : Int\n , name : String\n , email : String\n }\n\n userDecoder : Decoder User\n userDecoder =\n decode User\n |> required \"id\" int\n |> requiredAt [ \"profile\", \"name\" ] string\n |> required \"email\" string\n\n \"\"\"\n {\n \"id\": 123,\n \"email\": \"sam@example.com\",\n \"profile\": { \"name\": \"Sam\" }\n }\n \"\"\"\n |> decodeString userDecoder\n --> Success { id = 123, name = \"Sam\", email = \"sam@example.com\" }\n\n","type":"List.List String.String -> OptimizedDecoder.Decoder a -> OptimizedDecoder.Decoder (a -> b) -> OptimizedDecoder.Decoder b"},{"name":"resolve","comment":" Convert a `Decoder (Result x a)` into a `Decoder a`. Useful when you want\nto perform some custom processing just before completing the decoding operation.\n\n import Json.Decode.Exploration exposing (..)\n\n type alias User =\n { id : Int\n , name : String\n , email : String\n }\n\n userDecoder : Decoder User\n userDecoder =\n let\n -- toDecoder gets run *after* all the\n -- (|> required ...) steps are done.\n toDecoder : Int -> String -> String -> Int -> Decoder User\n toDecoder id name email version =\n if version >= 2 then\n succeed (User id name email)\n else\n fail \"This JSON is from a deprecated source. Please upgrade!\"\n in\n decode toDecoder\n |> required \"id\" int\n |> required \"name\" string\n |> required \"email\" string\n |> required \"version\" int\n -- version is part of toDecoder,\n -- but it is not a part of User\n |> resolve\n\n \"\"\"\n {\n \"id\": 123,\n \"name\": \"Sam\",\n \"email\": \"sam@example.com\",\n \"version\": 3\n }\n \"\"\"\n |> decodeString userDecoder\n --> Success { id = 123, name = \"Sam\", email = \"sam@example.com\" }\n\n","type":"OptimizedDecoder.Decoder (OptimizedDecoder.Decoder a) -> OptimizedDecoder.Decoder a"}],"binops":[]},{"name":"Pages.Directory","comment":" The `Directory` type can be used to get the children of a given directory,\ncheck if a `PagePath` is within a `Directory`, or get the index page corresponding\nto the directory (if it is a `Directory pathKey WithIndex`).\n\n@docs Directory\n\n@docs includes\n\n\n## Getting a `Directory`'s corresponding index page\n\n@docs indexPath, WithIndex, WithoutIndex\n\n\n## Getting a `Directory`'s base path\n\n@docs basePathToString, basePath\n\n\n## Functions for use by generated code\n\n@docs withIndex, withoutIndex\n\n","unions":[{"name":"Directory","comment":" Represents a known Directory within your `content` folder\nof your `elm-pages` site.\n","args":["key","hasIndex"],"cases":[]},{"name":"WithIndex","comment":" Used for a `Directory` that has an index path directly at that path. See\n`Directory.indexPath`.\n","args":[],"cases":[]},{"name":"WithoutIndex","comment":" Used for a `Directory` that does not have an index path directly at that path. See\n`WithIndex` and `Directory.indexPath`.\n","args":[],"cases":[]}],"aliases":[],"values":[{"name":"basePath","comment":" Gives you the parts of the path of the directory.\n","type":"Pages.Directory.Directory key hasIndex -> List.List String.String"},{"name":"basePathToString","comment":" Get the path of the directory as a String. Same as `directory |> Directory.basePath |> String.join \"/\"`.\n","type":"Pages.Directory.Directory key hasIndex -> String.String"},{"name":"includes","comment":" Check if the `Directory` contains the `PagePath`. This can be useful\nfor styling a link in the navbar if you are in that folder. Note that\nthe `view` function gets passed the `currentPage` (`Pages.application` from\nyour generated `Pages.elm` module).\n\n import Element exposing (Element)\n import Element.Font as Font\n import Pages.Directory as Directory exposing (Directory)\n\n navbar : PagePath Pages.PathKey -> Element msg\n navbar currentPage =\n Element.row [ Element.spacing 15 ]\n [ navbarLink currentPath pages.docs.directory \"Docs\"\n , navbarLink currentPath pages.blog.directory \"Blog\"\n ]\n\n navbarLink :\n PagePath Pages.PathKey\n -> Directory Pages.PathKey Directory.WithIndex\n -> String\n -> Element msg\n navbarLink currentPath linkDirectory displayName =\n let\n isHighlighted =\n currentPath |> Directory.includes linkDirectory\n in\n Element.link\n (if isHighlighted then\n [ Font.underline\n , Font.color Palette.color.primary\n ]\n\n else\n []\n )\n { url = linkDirectory |> Directory.indexPath |> PagePath.toString\n , label = Element.text displayName\n }\n\n","type":"Pages.Directory.Directory key hasIndex -> Pages.PagePath.PagePath key -> Basics.Bool"},{"name":"indexPath","comment":" Get the `PagePath` for the given Directory.\n\n import Pages\n import Pages.Directory as Directory exposing (Directory)\n\n blogDirectory : Directory Pages.PathKey Directory.WithIndex\n blogDirectory =\n Pages.pages.blog.directory\n\n -- blogDirectory |> Directory.indexPath |> PagePath.toString\n -- => \"blog\"\n\nSee `Directory.includes` for an example of this in action.\n\n","type":"Pages.Directory.Directory key Pages.Directory.WithIndex -> Pages.PagePath.PagePath key"},{"name":"withIndex","comment":" Used by the generated `Pages.elm` module. There's no need to use this\noutside of the generated code.\n","type":"key -> List.List (Pages.PagePath.PagePath key) -> List.List String.String -> Pages.Directory.Directory key Pages.Directory.WithIndex"},{"name":"withoutIndex","comment":" Used by the generated `Pages.elm` module. There's no need to use this\noutside of the generated code.\n","type":"key -> List.List (Pages.PagePath.PagePath key) -> List.List String.String -> Pages.Directory.Directory key Pages.Directory.WithoutIndex"}],"binops":[]},{"name":"Pages.ImagePath","comment":" This module is analgous to `Pages.PagePath`, except it represents an\nImage Path rather than a Page Path. Rather than copy-pasting those docs, I'll\nnote the differences here. See the `Pages.PagePath` docs for more background.\n\n\n## Record-based `PagePath` lookup\n\nYou can lookup a specific static image path based on its path using the record-based lookup:\n\n Pages.images\n\nThis gives you a record, based on all the files in your local\n`images` directory, that lets you look paths up like so:\n\n import Pages\n import Pages.ImagePath as ImagePath exposing (ImagePath)\n\n homePath : ImagePath Pages.PathKey\n homePath =\n Pages.pages.index\n\n -- ImagePath.toString homePath\n -- => \"\"\n\nor\n\n import Pages\n import Pages.ImagePath as ImagePath exposing (ImagePath)\n\n dillonProfilePhoto : ImagePath Pages.PathKey\n dillonProfilePhoto =\n Pages.images.profilePhotos.dillon\n\n -- ImagePath.toString helloWorldPostPath\n -- => \"images/profile-photos/dillon.jpg\"\n\n@docs ImagePath, toString, toAbsoluteUrl, external, dimensions, Dimensions\n\n\n## Functions for code generation only\n\nDon't bother using these.\n\n@docs build\n\n","unions":[{"name":"ImagePath","comment":" There are only two ways to get an `ImagePath`:\n\n1. Get a value using the generated `Pages.elm` module in your repo (see above), or\n2. Generate an external route using `PagePath.external`.\n\nSo `ImagePath` represents either a 1) known, static image asset path, or 2) an\nexternal image path (which is not validated so use these carefully!).\n\n","args":["key"],"cases":[]}],"aliases":[{"name":"Dimensions","comment":" The intrinsic dimensions of the image in pixels.\n","args":[],"type":"{ width : Basics.Int, height : Basics.Int }"}],"values":[{"name":"build","comment":" This is not useful except for the internal generated code to construct an `ImagePath`.\n","type":"key -> List.List String.String -> Pages.ImagePath.Dimensions -> Pages.ImagePath.ImagePath key"},{"name":"dimensions","comment":" The dimensions of the image at that path.\n\nSince we do not know the dimensions of external images, created with [`external`](#external), we might get `Nothing`!\n\n","type":"Pages.ImagePath.ImagePath key -> Maybe.Maybe Pages.ImagePath.Dimensions"},{"name":"external","comment":" This allows you to build a URL to an external resource. Avoid using\n`ImagePath.external` to refer to statically available image resources. Instead, use\nthis only to point to outside images.\n\n import Pages\n import Pages.ImagePath as ImagePath exposing (ImagePath)\n\n\n -- The `Pages` module is generated in your codebase.\n -- Notice that we can still annotate this external image\n -- with `Pages.PathKey`, since external images are always valid\n -- (unlike internal images, which are guaranteed to be present\n -- if your code compiles).\n benchmarkImagePath : ImagePath Pages.PathKey\n benchmarkImagePath =\n PagePath.external \"https://elm-lang.org/assets/home/benchmark.png\"\n\n -- ImagePath.toString benchmarkImagePath\n -- => \"https://elm-lang.org/assets/home/benchmark.png\"\n\n","type":"String.String -> Pages.ImagePath.ImagePath key"},{"name":"toAbsoluteUrl","comment":" Gives you the image's absolute URL as a String. This is useful for constructing `<img>` tags:\n","type":"String.String -> Pages.ImagePath.ImagePath key -> String.String"},{"name":"toString","comment":" Gives you the image's relative URL as a String. This is useful for constructing `<img>` tags:\n\n import Html exposing (Html, img)\n import Html.Attributes exposing (src)\n import Pages\n import Pages.ImagePath as ImagePath exposing (ImagePath)\n\n\n -- `Pages` is a generated module\n logoImagePath : ImagePath Pages.PathKey\n logoImagePath =\n Pages.pages.index\n\n linkToHome : Html msg\n linkToHome =\n img [ src (ImagePath.toString logoImagePath) ] []\n\n","type":"Pages.ImagePath.ImagePath key -> String.String"}],"binops":[]},{"name":"Pages.Internal","comment":" You don't need to use this unless you want to play around with the internals of `elm-pages` to build\na similar framework and hook into the low-level details. Otherwise, just grab the `Pages.Internal.Internal` value\nthat is in the generated `Pages` module (see <Pages.Platform>).\n\n@docs Internal\n\n@docs ApplicationType\n\n","unions":[{"name":"ApplicationType","comment":" Internal detail to track whether to run the CLI step or the runtime step in the browser.\n","args":[],"cases":[["Browser",[]],["Cli",[]]]}],"aliases":[{"name":"Internal","comment":" This type is generated for you in your `gen/Pages.elm` module (see <Pages.Platform>).\n","args":["pathKey"],"type":"{ applicationType : Pages.Internal.ApplicationType, content : Pages.Internal.Platform.Content, pathKey : pathKey, toJsPort : Json.Encode.Value -> Platform.Cmd.Cmd Basics.Never, fromJsPort : Platform.Sub.Sub Json.Decode.Value }"}],"values":[],"binops":[]},{"name":"Pages.Manifest","comment":" Represents the configuration of a\n[web manifest file](https://developer.mozilla.org/en-US/docs/Web/Manifest).\n\nYou pass your `Pages.Manifest.Config` record into the `Pages.application` function\n(from your generated `Pages.elm` file).\n\n import Pages\n import Pages.Manifest as Manifest\n import Pages.Manifest.Category\n import Pages.PagePath as PagePath exposing (PagePath)\n import Palette\n\n manifest : Manifest.Config Pages.PathKey\n manifest =\n { backgroundColor = Just Color.white\n , categories = [ Pages.Manifest.Category.education ]\n , displayMode = Manifest.Standalone\n , orientation = Manifest.Portrait\n , description = \"elm-pages - A statically typed site generator.\"\n , iarcRatingId = Nothing\n , name = \"elm-pages docs\"\n , themeColor = Just Color.white\n , startUrl = Pages.pages.index\n , shortName = Just \"elm-pages\"\n , sourceIcon = Pages.images.icon\n }\n\n main : Pages.Program Model Msg Metadata (List (Element Msg))\n main =\n Pages.application\n { init = init\n , view = view\n , update = update\n , subscriptions = subscriptions\n , documents = [ markdownDocument ]\n , head = head\n , manifest = manifest\n , canonicalSiteUrl = canonicalSiteUrl\n }\n\n@docs Config, Icon\n\n\n## Config options\n\n@docs DisplayMode, Orientation, IconPurpose\n\n\n## Functions for use by the generated code (`Pages.elm`)\n\n@docs toJson\n\n","unions":[{"name":"DisplayMode","comment":" See <https://developer.mozilla.org/en-US/docs/Web/Manifest/display>\n","args":[],"cases":[["Fullscreen",[]],["Standalone",[]],["MinimalUi",[]],["Browser",[]]]},{"name":"IconPurpose","comment":" <https://w3c.github.io/manifest/#dfn-icon-purposes>\n","args":[],"cases":[["IconPurposeMonochrome",[]],["IconPurposeMaskable",[]],["IconPurposeAny",[]]]},{"name":"Orientation","comment":" <https://developer.mozilla.org/en-US/docs/Web/Manifest/orientation>\n","args":[],"cases":[["Any",[]],["Natural",[]],["Landscape",[]],["LandscapePrimary",[]],["LandscapeSecondary",[]],["Portrait",[]],["PortraitPrimary",[]],["PortraitSecondary",[]]]}],"aliases":[{"name":"Config","comment":" Represents a [web app manifest file](https://developer.mozilla.org/en-US/docs/Web/Manifest)\n(see above for how to use it).\n\nThe `sourceIcon` is used to automatically generate all of the Favicons and manifest\nicons of the appropriate sizes (512x512, etc) for Android, iOS, etc. So you just\npoint at a single image asset and you will have optimized images following all\nthe best practices!\n\n\n## Type-safe static paths\n\nThe `pathKey` in this type is used to ensure that you are using\nknown static resources for any internal image or page paths.\n\n - The `startUrl` is a type-safe `PagePath`, ensuring that any internal links\n are present (not broken links).\n - The `sourceIcon` is a type-safe `ImagePath`, ensuring that any internal images\n are present (not broken images).\n\n","args":["pathKey"],"type":"{ backgroundColor : Maybe.Maybe Color.Color, categories : List.List Pages.Manifest.Category.Category, displayMode : Pages.Manifest.DisplayMode, orientation : Pages.Manifest.Orientation, description : String.String, iarcRatingId : Maybe.Maybe String.String, name : String.String, themeColor : Maybe.Maybe Color.Color, startUrl : Pages.PagePath.PagePath pathKey, shortName : Maybe.Maybe String.String, sourceIcon : Pages.ImagePath.ImagePath pathKey, icons : List.List (Pages.Manifest.Icon pathKey) }"},{"name":"Icon","comment":" <https://developer.mozilla.org/en-US/docs/Web/Manifest/icons>\n","args":["pathKey"],"type":"{ src : Pages.ImagePath.ImagePath pathKey, sizes : List.List ( Basics.Int, Basics.Int ), mimeType : Maybe.Maybe MimeType.MimeImage, purposes : List.List Pages.Manifest.IconPurpose }"}],"values":[{"name":"toJson","comment":" Feel free to use this, but in 99% of cases you won't need it. The generated\ncode will run this for you to generate your `manifest.json` file automatically!\n","type":"String.String -> Pages.Manifest.Config pathKey -> Json.Encode.Value"}],"binops":[]},{"name":"Pages.Manifest.Category","comment":" See <https://github.com/w3c/manifest/wiki/Categories> and\n<https://developer.mozilla.org/en-US/docs/Web/Manifest/categories>\n\n@docs toString, Category\n\n@docs books, business, education, entertainment, finance, fitness, food, games, government, health, kids, lifestyle, magazines, medical, music, navigation, news, personalization, photo, politics, productivity, security, shopping, social, sports, travel, utilities, weather\n\n\n## Custom categories\n\n@docs custom\n\n","unions":[{"name":"Category","comment":" Represents a known, valid category, as specified by\n<https://github.com/w3c/manifest/wiki/Categories>. If this document is updated\nand I don't add it, please open an issue or pull request to let me know!\n","args":[],"cases":[]}],"aliases":[],"values":[{"name":"books","comment":" Creates the described category.\n","type":"Pages.Manifest.Category.Category"},{"name":"business","comment":" Creates the described category.\n","type":"Pages.Manifest.Category.Category"},{"name":"custom","comment":" It's best to use the pre-defined categories to ensure that clients (Android, iOS,\nChrome, Windows app store, etc.) are aware of it and can handle it appropriately.\nBut, if you're confident about using a custom one, you can do so with `Pages.Manifest.custom`.\n","type":"String.String -> Pages.Manifest.Category.Category"},{"name":"education","comment":" Creates the described category.\n","type":"Pages.Manifest.Category.Category"},{"name":"entertainment","comment":" Creates the described category.\n","type":"Pages.Manifest.Category.Category"},{"name":"finance","comment":" Creates the described category.\n","type":"Pages.Manifest.Category.Category"},{"name":"fitness","comment":" Creates the described category.\n","type":"Pages.Manifest.Category.Category"},{"name":"food","comment":" Creates the described category.\n","type":"Pages.Manifest.Category.Category"},{"name":"games","comment":" Creates the described category.\n","type":"Pages.Manifest.Category.Category"},{"name":"government","comment":" Creates the described category.\n","type":"Pages.Manifest.Category.Category"},{"name":"health","comment":" Creates the described category.\n","type":"Pages.Manifest.Category.Category"},{"name":"kids","comment":" Creates the described category.\n","type":"Pages.Manifest.Category.Category"},{"name":"lifestyle","comment":" Creates the described category.\n","type":"Pages.Manifest.Category.Category"},{"name":"magazines","comment":" Creates the described category.\n","type":"Pages.Manifest.Category.Category"},{"name":"medical","comment":" Creates the described category.\n","type":"Pages.Manifest.Category.Category"},{"name":"music","comment":" Creates the described category.\n","type":"Pages.Manifest.Category.Category"},{"name":"navigation","comment":" Creates the described category.\n","type":"Pages.Manifest.Category.Category"},{"name":"news","comment":" Creates the described category.\n","type":"Pages.Manifest.Category.Category"},{"name":"personalization","comment":" Creates the described category.\n","type":"Pages.Manifest.Category.Category"},{"name":"photo","comment":" Creates the described category.\n","type":"Pages.Manifest.Category.Category"},{"name":"politics","comment":" Creates the described category.\n","type":"Pages.Manifest.Category.Category"},{"name":"productivity","comment":" Creates the described category.\n","type":"Pages.Manifest.Category.Category"},{"name":"security","comment":" Creates the described category.\n","type":"Pages.Manifest.Category.Category"},{"name":"shopping","comment":" Creates the described category.\n","type":"Pages.Manifest.Category.Category"},{"name":"social","comment":" Creates the described category.\n","type":"Pages.Manifest.Category.Category"},{"name":"sports","comment":" Creates the described category.\n","type":"Pages.Manifest.Category.Category"},{"name":"toString","comment":" Turn a category into its official String representation, as seen\nhere: <https://github.com/w3c/manifest/wiki/Categories>.\n","type":"Pages.Manifest.Category.Category -> String.String"},{"name":"travel","comment":" Creates the described category.\n","type":"Pages.Manifest.Category.Category"},{"name":"utilities","comment":" Creates the described category.\n","type":"Pages.Manifest.Category.Category"},{"name":"weather","comment":" Creates the described category.\n","type":"Pages.Manifest.Category.Category"}],"binops":[]},{"name":"Pages.PagePath","comment":" You can get data representing type-safe, guaranteed-available\nroutes from your generated `Pages` module in your repo. If the file\nis not available, make sure you've run `elm-pages develop`.\n\nThe `key` in the `PagePath key` type protects you from using\na route that is not from the static routes that the generated\n`Pages.elm` module provides. That means that if you use one of these values,\nyou can completely trust it and get helpful compiler errors if you mispell something\nor access a dead link!\n\nThe static `PagePath`s for your site are generated so you can grab them in\ntwo ways:\n\n\n## List-based `PagePath` lookup\n\nYou will find a list of all the pages in your app in this generated code:\n\n Pages.allPages : List (PagePath Pages.PathKey)\n\nThis is handy for creating an index page, for example showing all\nthe blog posts in your site.\n\n\n## Record-based `PagePath` lookup\n\nYou can lookup a specific static route based on its path using the record-based lookup:\n\n Pages.pages\n\nThis gives you a record, based on your local `content` directory, that lets you look paths up like so:\n\n import Pages\n import Pages.PagePath as PagePath exposing (PagePath)\n\n homePath : PagePath Pages.PathKey\n homePath =\n Pages.pages.index\n\n -- PagePath.toString homePath\n -- => \"\"\n\nor\n\n import Pages\n import Pages.PagePath as PagePath exposing (PagePath)\n\n helloWorldPostPath : PagePath Pages.PathKey\n helloWorldPostPath =\n Pages.pages.blog.helloWorld\n\n -- PagePath.toString helloWorldPostPath\n -- => \"blog/hello-world\"\n\nNote that in the `hello-world` example it changes from the kebab casing of the actual\nURL to camelCasing for the record key.\n\nThis is useful for referring to static routes directly from your Elm code (you'll\nneed a different technique for verifying that a link in your markup content\nis valid).\n\nFor example, you might have a navbar that links to specific routes.\n\n@docs PagePath, toString, external, toPath\n\n\n## Functions for code generation only\n\nDon't bother using these.\n\n@docs build\n\n","unions":[{"name":"PagePath","comment":" There are only two ways to get a `PagePath`:\n\n1. Get a value using the generated `Pages.elm` module in your repo (see above), or\n2. Generate an external route using `PagePath.external`.\n\nSo `PagePath` represents either a 1) known, static page path, or 2) an\nexternal page path (which is not validated so use these carefully!).\n\n","args":["key"],"cases":[]}],"aliases":[],"values":[{"name":"build","comment":" This is not useful except for the internal generated code to construct a PagePath.\n","type":"key -> List.List String.String -> Pages.PagePath.PagePath key"},{"name":"external","comment":" This allows you to build a URL to an external resource. Avoid using\n`PagePath.external` to refer to statically available routes. Instead, use\nthis only to point to outside pages.\n\n import Pages\n import Pages.PagePath as PagePath exposing (PagePath)\n\n\n -- The `Pages` module is generated in your codebase.\n -- Notice that we can still annotate this external link\n -- with `Pages.PathKey`, since external links are always valid\n -- (unlike internal routes, which are guaranteed to be present\n -- if your code compiles).\n googlePath : PagePath Pages.PathKey\n googlePath =\n PagePath.external \"https://google.com\"\n\n","type":"String.String -> Pages.PagePath.PagePath key"},{"name":"toPath","comment":" Get a List of each part of the path.\n\n indexPathParts =\n PagePath.toPath Pages.pages.index == []\n\n blogPostPathParts =\n PagePath.toPath Pages.pages.blog.hello == [ \"blog\", \"hello\" ]\n\n","type":"Pages.PagePath.PagePath key -> List.List String.String"},{"name":"toString","comment":" Gives you the page's relative URL as a String. This is useful for constructing links:\n\n import Html exposing (Html, a)\n import Html.Attributes exposing (href)\n import Pages\n import Pages.PagePath as PagePath exposing (PagePath)\n\n\n -- `Pages` is a generated module\n homePath : PagePath Pages.PathKey\n homePath =\n Pages.pages.index\n\n linkToHome : Html msg\n linkToHome =\n a [ href (PagePath.toString homePath) ] [ text \"🏡 Home\" ]\n\n","type":"Pages.PagePath.PagePath key -> String.String"}],"binops":[]},{"name":"Pages.Platform","comment":" Configure your `elm-pages` Program, similar to a `Browser.application`.\n\nThis is the entry point for your `elm-pages` application.\n\nThis is similar to how you set up a regular Elm application using `Browser.application`, but with a few differences.\n\n - `view` has access to `StaticHttp` data (see [Pages.StaticHttp](#Pages.StaticHttp)).\n - `view` is able to set `head` tags which can be used for site metadata and SEO data.\n - `manifest` lets you configure the manifest.json for your PWA (Progressive Web App).\n - `canonicalSiteUrl` is the default domain for your `<head>` tags for SEO purposes (you can override it with `canonicalUrlOverride`,\n see <Head.Seo>. Learn more about canonical URLs and why they are important [in this article](https://yoast.com/rel-canonical/).\n - `internals` is an opaque data type with some internal boilerplate from your `elm-pages` content. You should pass it `internals = Pages.internals`.\n\nOtherwise, you have a standard Elm app which\n\n\n## `elm-pages` Lifecycle\n\nIt's helpful to understand the `elm-pages` lifecycle and how it compares to a vanilla elm app (i.e. a `Browser.application`).\n\n\n### Generate Step (`elm-pages build`)\n\nWhereas a vanilla Elm app simply compiles your Elm code at build time, `elm-pages` performs some lifecycle events at this stage.\n\n - Performs all `StaticHttp.Request`s (see <Pages.StaticHttp>) for every static page in your app. The StaticHttp Responses are stored in JSON\n files called `content.json` (one JSON file for each static page in your site).\n - Pre-renders HTML pages, including the `<head>` tags for the page from your `view`'s `head`.\n - Optimizes image assets and copies over files from `static` folder to the `dist` folder.\n\n\n### Initial Load (from user's browser)\n\nThe user will see the pre-rendered HTML when they initially load a page on your `elm-pages` site (unless you are in dev mode, i.e. `elm-pages develop`, in\nwhich case there is no pre-rendering).\n\n\n### Hydration\n\n - Fetch all the `StaticHttp` responses and page data (the `content.json` file for the current page).\n - The Elm app hydrates and starts executing and running your Elm app's `init` function and `update` loop (not just the pre-rendered HTML content).\n At this point, all of your `subscriptions`, etc. will behave as they would in a regular Elm application.\n - The app will now run as a single-page app. When you hover over a link to another static page on your current site,\n it will pre-fetch the page data (`content.json` file), so that the page load is instant.\n\n\n## Basic application config\n\n@docs Builder, init, toProgram\n\n@docs Program, Page\n\n\n## Additional application config\n\n@docs withGlobalHeadTags, withFileGenerator\n\n","unions":[{"name":"Builder","comment":" You can [`init`](#init) a `Builder`, and then turn it to a [`Program`](#Program) with [`toProgram`](#toProgram).\n\nThat gives you the basic options, then you can [include optional configuration](#additional-application-config).\n\n","args":["pathKey","model","msg","metadata","view"],"cases":[]}],"aliases":[{"name":"Page","comment":" ","args":["metadata","view","pathKey"],"type":"{ metadata : metadata, path : Pages.PagePath.PagePath pathKey, view : view }"},{"name":"Program","comment":" The `Program` type for an `elm-pages` app.\n","args":["model","msg","metadata","view","pathKey"],"type":"Pages.Internal.Platform.Program model msg metadata view pathKey"}],"values":[{"name":"init","comment":" Pass the initial required configuration for your `elm-pages` application.\n\nHere's a basic example.\n\n import Pages.Platform\n\n main : Pages.Platform.Program Model Msg Metadata View\n main =\n Pages.Platform.init\n { init = init\n , view = view\n , update = update\n , subscriptions = subscriptions\n , documents =\n [ { extension = \"md\"\n , metadata = Metadata.decoder\n , body = MarkdownRenderer.view\n }\n ]\n , onPageChange = Just OnPageChange\n , manifest = manifest\n , canonicalSiteUrl = canonicalSiteUrl\n , internals = Pages.internals\n }\n |> Pages.Platform.toProgram\n\n","type":"{ init : Maybe.Maybe { path : Pages.PagePath.PagePath pathKey, query : Maybe.Maybe String.String, fragment : Maybe.Maybe String.String } -> ( model, Platform.Cmd.Cmd msg ), update : msg -> model -> ( model, Platform.Cmd.Cmd msg ), view : List.List ( Pages.PagePath.PagePath pathKey, metadata ) -> { path : Pages.PagePath.PagePath pathKey, frontmatter : metadata } -> Pages.StaticHttp.Request { view : model -> view -> { title : String.String, body : Html.Html msg }, head : List.List (Head.Tag pathKey) }, subscriptions : model -> Platform.Sub.Sub msg, documents : List.List { extension : String.String, metadata : Json.Decode.Decoder metadata, body : String.String -> Result.Result String.String view }, onPageChange : Maybe.Maybe ({ path : Pages.PagePath.PagePath pathKey, query : Maybe.Maybe String.String, fragment : Maybe.Maybe String.String } -> msg), manifest : Pages.Manifest.Config pathKey, canonicalSiteUrl : String.String, internals : Pages.Internal.Internal pathKey } -> Pages.Platform.Builder pathKey model msg metadata view"},{"name":"toProgram","comment":" When you're done with your builder pipeline, you complete it with `Pages.Platform.toProgram`.\n","type":"Pages.Platform.Builder pathKey model msg metadata view -> Pages.Platform.Program model msg metadata view pathKey"},{"name":"withFileGenerator","comment":" Include files to be generated. Any `Err` values will turn into a build error.\n\nYou can use StaticHttp data here, and it won't be included in your production build (it will just be fetched as needed\nduring the build step). You also have access to all of your site's pages, with their path, metadata, and body.\n\nSome use cases are to generate\n\n - A sitemap\n - An RSS feed\n - A robots.txt file\n - Podcast feeds\n - Configuration files (e.g. Netlify CMS config)\n\n```elm\n import Pages.Platform\n\n withRobotsTxt builder =\n builder\n |> Pages.Platform.withFileGenerator\n (\\siteMetadata ->\n StaticHttp.succeed\n [ Ok\n { path = [ \"robots.txt\" ]\n , content = \"\"\"\nUser-agent: *\nDisallow: /cgi-bin/\n \"\"\"\n }\n ]\n )\n```\n\n","type":"(List.List { path : Pages.PagePath.PagePath pathKey, frontmatter : metadata, body : String.String } -> Pages.StaticHttp.Request (List.List (Result.Result String.String { path : List.List String.String, content : String.String }))) -> Pages.Platform.Builder pathKey model msg metadata view -> Pages.Platform.Builder pathKey model msg metadata view"},{"name":"withGlobalHeadTags","comment":" Add some head tags that will be included on every page of your `elm-pages` site.\n","type":"List.List (Head.Tag pathKey) -> Pages.Platform.Builder pathKey model msg metadata view -> Pages.Platform.Builder pathKey model msg metadata view"}],"binops":[]},{"name":"Pages.Secrets","comment":" Secrets are a secure way to use environment variables in your StaticHttp requests. The actual environment\nvariable value is used to perform StaticHttp requests, while the masked value is the only thing that ends up in your\nbuilt site. Let's go through what happens in a concrete example:\n\n\n## Example\n\nLet's say you execute this from the shell:\n\n```shell\nGITHUB_TOKEN=abcd1234 API_KEY=xyz789 elm-pages build\n```\n\nAnd your StaticHttp request in your Elm code looks like this:\n\n import Pages.Secrets as Secrets\n import Pages.StaticHttp as StaticHttp\n\n StaticHttp.request\n (Secrets.succeed\n (\\apiKey githubToken ->\n { url = \"https://api.github.com/repos/dillonkearns/elm-pages?apiKey=\" ++ apiKey\n , method = \"GET\"\n , headers = [ ( \"Authorization\", \"Bearer \" ++ githubToken ) ]\n }\n )\n |> Secrets.with \"API_KEY\"\n |> Secrets.with \"BEARER\"\n )\n (Decode.succeed ())\n )\n\nThe following masked values are what will be visible in your production bundle if you inspect the code or the Network tab:\n\n [GET]https://api.github.com/repos/dillonkearns/elm-pages?apiKey=<API_KEY>Authorization : Bearer <BEARER>\n\nSo the actual Secrets only exist for the duration of the build in order to perform the StaticHttp requests, but they\nare replaced with `<SECRET_NAME>` once that step is done and your assets are bundled.\n\n@docs Value, map, succeed, with\n\n","unions":[],"aliases":[{"name":"Value","comment":" Represents a Secure value from your environment variables. `Pages.Secrets.Value`s are much like `Json.Decode.Value`s\nin that you can take raw values, map them, and combine them with other values into any data structure.\n","args":["value"],"type":"Secrets.Value value"}],"values":[{"name":"map","comment":" Map a Secret's raw value into an arbitrary type or value.\n","type":"(valueA -> valueB) -> Pages.Secrets.Value valueA -> Pages.Secrets.Value valueB"},{"name":"succeed","comment":" Hardcode a secret value. Or, this can be used to start a pipeline-style value with several different secrets (see\nthe example at the top of this page).\n\n import Pages.Secrets as Secrets\n\n Secrets.succeed \"hardcoded-secret\"\n\n","type":"value -> Pages.Secrets.Value value"},{"name":"with","comment":" Allows you to chain together multiple secrets. See the top of this page for a full example.\n","type":"String.String -> Pages.Secrets.Value (String.String -> value) -> Pages.Secrets.Value value"}],"binops":[]},{"name":"Pages.StaticHttp","comment":" StaticHttp requests are an alternative to doing Elm HTTP requests the traditional way using the `elm/http` package.\n\nThe key differences are:\n\n - `StaticHttp.Request`s are performed once at build time (`Http.Request`s are performed at runtime, at whenever point you perform them)\n - `StaticHttp.Request`s strip out unused JSON data from the data your decoder doesn't touch to minimize the JSON payload\n - `StaticHttp.Request`s can use [`Pages.Secrets`](Pages.Secrets) to securely use credentials from your environment variables which are completely masked in the production assets.\n - `StaticHttp.Request`s have a built-in `StaticHttp.andThen` that allows you to perform follow-up requests without using tasks\n\n\n## Scenarios where StaticHttp is a good fit\n\nIf you need data that is refreshed often you may want to do a traditional HTTP request with the `elm/http` package.\nThe kinds of situations that are served well by static HTTP are with data that updates moderately frequently or infrequently (or never).\nA common pattern is to trigger a new build when data changes. Many JAMstack services\nallow you to send a WebHook to your host (for example, Netlify is a good static file host that supports triggering builds with webhooks). So\nyou may want to have your site rebuild everytime your calendar feed has an event added, or whenever a page or article is added\nor updated on a CMS service like Contentful.\n\nIn scenarios like this, you can serve data that is just as up-to-date as it would be using `elm/http`, but you get the performance\ngains of using `StaticHttp.Request`s as well as the simplicity and robustness that comes with it. Read more about these benefits\nin [this article introducing StaticHttp requests and some concepts around it](https://elm-pages.com/blog/static-http).\n\n\n## Scenarios where StaticHttp is not a good fit\n\n - Data that is specific to the logged-in user\n - Data that needs to be the very latest and changes often (for example, sports scores)\n\n@docs Request, RequestDetails\n@docs get, request\n@docs map, succeed, fail\n\n\n## Building a StaticHttp Request Body\n\nThe way you build a body is analagous to the `elm/http` package. Currently, only `emptyBody` and\n`stringBody` are supported. If you have a use case that calls for a different body type, please open a Github issue\nand describe your use case!\n\n@docs Body, emptyBody, stringBody, jsonBody\n\n\n## Chaining Requests\n\n@docs andThen, resolve, combine\n\n@docs map2, map3, map4, map5, map6, map7, map8, map9\n\n\n## Unoptimized Requests\n\nWarning - use these at your own risk! It's highly recommended that you use the other request functions that make use of\n`zwilias/json-decode-exploration` in order to allow you to reduce down your JSON to only the values that are used by\nyour decoders. This can significantly reduce download sizes for your StaticHttp requests.\n\n@docs unoptimizedRequest\n\n\n### Expect for unoptimized requests\n\n@docs Expect, expectString, expectUnoptimizedJson\n\n","unions":[{"name":"Expect","comment":" Analgous to the `Expect` type in the `elm/http` package. This represents how you will process the data that comes\nback in your StaticHttp request.\n\nYou can derive `ExpectUnoptimizedJson` from `ExpectString`. Or you could build your own helper to process the String\nas XML, for example, or give an `elm-pages` build error if the response can't be parsed as XML.\n\n","args":["value"],"cases":[]}],"aliases":[{"name":"Body","comment":" A body for a StaticHttp request.\n","args":[],"type":"Pages.Internal.StaticHttpBody.Body"},{"name":"Request","comment":" A Request that will be made a build time. Multiple `StaticHttp.Request`s can be combined together using the `mapN` functions,\nvery similar to how you can manipulate values with Json Decoders in Elm.\n","args":["value"],"type":"Pages.StaticHttpRequest.Request value"},{"name":"RequestDetails","comment":" The full details to perform a StaticHttp request.\n","args":[],"type":"{ url : String.String, method : String.String, headers : List.List ( String.String, String.String ), body : Pages.StaticHttp.Body }"}],"values":[{"name":"andThen","comment":" Build off of the response from a previous `StaticHttp` request to build a follow-up request. You can use the data\nfrom the previous response to build up the URL, headers, etc. that you send to the subsequent request.\n\n import Json.Decode as Decode exposing (Decoder)\n import Pages.StaticHttp as StaticHttp\n\n licenseData : StaticHttp.Request String\n licenseData =\n StaticHttp.get\n (Secrets.succeed \"https://api.github.com/repos/dillonkearns/elm-pages\")\n (Decode.at [ \"license\", \"url\" ] Decode.string)\n |> StaticHttp.andThen\n (\\licenseUrl ->\n StaticHttp.get (Secrets.succeed licenseUrl) (Decode.field \"description\" Decode.string)\n )\n\n","type":"(a -> Pages.StaticHttp.Request b) -> Pages.StaticHttp.Request a -> Pages.StaticHttp.Request b"},{"name":"combine","comment":" Turn a list of `StaticHttp.Request`s into a single one.\n\n import Json.Decode as Decode exposing (Decoder)\n import Pages.StaticHttp as StaticHttp\n\n type alias Pokemon =\n { name : String\n , sprite : String\n }\n\n pokemonDetailRequest : StaticHttp.Request (List Pokemon)\n pokemonDetailRequest =\n StaticHttp.get\n (Secrets.succeed \"https://pokeapi.co/api/v2/pokemon/?limit=3\")\n (Decode.field \"results\"\n (Decode.list\n (Decode.map2 Tuple.pair\n (Decode.field \"name\" Decode.string)\n (Decode.field \"url\" Decode.string)\n |> Decode.map\n (\\( name, url ) ->\n StaticHttp.get (Secrets.succeed url)\n (Decode.at\n [ \"sprites\", \"front_default\" ]\n Decode.string\n |> Decode.map (Pokemon name)\n )\n )\n )\n )\n )\n |> StaticHttp.andThen StaticHttp.combine\n\n","type":"List.List (Pages.StaticHttp.Request value) -> Pages.StaticHttp.Request (List.List value)"},{"name":"emptyBody","comment":" Build an empty body for a StaticHttp request. See [elm/http's `Http.emptyBody`](https://package.elm-lang.org/packages/elm/http/latest/Http#emptyBody).\n","type":"Pages.StaticHttp.Body"},{"name":"expectString","comment":" Request a raw String. You can validate the String if you need to check the formatting, or try to parse it\nin something besides JSON. Be sure to use the `StaticHttp.request` function if you want an optimized request that\nstrips out unused JSON to optimize your asset size.\n\nIf the function you pass to `expectString` yields an `Err`, then you will get at StaticHttpDecodingError that will\nfail your `elm-pages` build and print out the String from the `Err`.\n\n request =\n StaticHttp.unoptimizedRequest\n (Secrets.succeed\n { url = \"https://example.com/file.txt\"\n , method = \"GET\"\n , headers = []\n , body = StaticHttp.emptyBody\n }\n )\n (StaticHttp.expectString\n (\\string ->\n if String.toUpper string == string then\n Ok string\n\n else\n Err \"String was not uppercased\"\n )\n )\n\n","type":"(String.String -> Result.Result String.String value) -> Pages.StaticHttp.Expect value"},{"name":"expectUnoptimizedJson","comment":" Handle the incoming response as JSON and don't optimize the asset and strip out unused values.\nBe sure to use the `StaticHttp.request` function if you want an optimized request that\nstrips out unused JSON to optimize your asset size. This function makes sense to use for things like a GraphQL request\nwhere the JSON payload is already trimmed down to the data you explicitly requested.\n\nIf the function you pass to `expectString` yields an `Err`, then you will get at StaticHttpDecodingError that will\nfail your `elm-pages` build and print out the String from the `Err`.\n\n","type":"Json.Decode.Decoder value -> Pages.StaticHttp.Expect value"},{"name":"fail","comment":" Stop the StaticHttp chain with the given error message. If you reach a `fail` in your request,\nyou will get a build error. Or in the dev server, you will see the error message in an overlay in your browser (and in\nthe terminal).\n","type":"String.String -> Pages.StaticHttp.Request a"},{"name":"get","comment":" A simplified helper around [`StaticHttp.request`](#request), which builds up a StaticHttp GET request.\n\n import Json.Decode as Decode exposing (Decoder)\n import Pages.StaticHttp as StaticHttp\n\n getRequest : StaticHttp.Request Int\n getRequest =\n StaticHttp.get\n (Secrets.succeed \"https://api.github.com/repos/dillonkearns/elm-pages\")\n (Decode.field \"stargazers_count\" Decode.int)\n\n","type":"Pages.Secrets.Value String.String -> OptimizedDecoder.Decoder a -> Pages.StaticHttp.Request a"},{"name":"jsonBody","comment":" Builds a JSON body for a StaticHttp request. See [elm/http's `Http.jsonBody`](https://package.elm-lang.org/packages/elm/http/latest/Http#jsonBody).\n","type":"Json.Encode.Value -> Pages.StaticHttp.Body"},{"name":"map","comment":" Transform a request into an arbitrary value. The same underlying HTTP requests will be performed during the build\nstep, but mapping allows you to change the resulting values by applying functions to the results.\n\nA common use for this is to map your data into your elm-pages view:\n\n import Json.Decode as Decode exposing (Decoder)\n import Pages.StaticHttp as StaticHttp\n\n view =\n StaticHttp.get\n (Secrets.succeed \"https://api.github.com/repos/dillonkearns/elm-pages\")\n (Decode.field \"stargazers_count\" Decode.int)\n |> StaticHttp.map\n (\\stars ->\n { view =\n \\model viewForPage ->\n { title = \"Current stars: \" ++ String.fromInt stars\n , body = Html.text <| \"⭐️ \" ++ String.fromInt stars\n , head = []\n }\n }\n )\n\n","type":"(a -> b) -> Pages.StaticHttp.Request a -> Pages.StaticHttp.Request b"},{"name":"map2","comment":" Like map, but it takes in two `Request`s.\n\n view siteMetadata page =\n StaticHttp.map2\n (\\elmPagesStars elmMarkdownStars ->\n { view =\n \\model viewForPage ->\n { title = \"Repo Stargazers\"\n , body = starsView elmPagesStars elmMarkdownStars\n }\n , head = head elmPagesStars elmMarkdownStars\n }\n )\n (get\n (Secrets.succeed \"https://api.github.com/repos/dillonkearns/elm-pages\")\n (Decode.field \"stargazers_count\" Decode.int)\n )\n (get\n (Secrets.succeed \"https://api.github.com/repos/dillonkearns/elm-markdown\")\n (Decode.field \"stargazers_count\" Decode.int)\n )\n\n","type":"(a -> b -> c) -> Pages.StaticHttp.Request a -> Pages.StaticHttp.Request b -> Pages.StaticHttp.Request c"},{"name":"map3","comment":" ","type":"(value1 -> value2 -> value3 -> valueCombined) -> Pages.StaticHttp.Request value1 -> Pages.StaticHttp.Request value2 -> Pages.StaticHttp.Request value3 -> Pages.StaticHttp.Request valueCombined"},{"name":"map4","comment":" ","type":"(value1 -> value2 -> value3 -> value4 -> valueCombined) -> Pages.StaticHttp.Request value1 -> Pages.StaticHttp.Request value2 -> Pages.StaticHttp.Request value3 -> Pages.StaticHttp.Request value4 -> Pages.StaticHttp.Request valueCombined"},{"name":"map5","comment":" ","type":"(value1 -> value2 -> value3 -> value4 -> value5 -> valueCombined) -> Pages.StaticHttp.Request value1 -> Pages.StaticHttp.Request value2 -> Pages.StaticHttp.Request value3 -> Pages.StaticHttp.Request value4 -> Pages.StaticHttp.Request value5 -> Pages.StaticHttp.Request valueCombined"},{"name":"map6","comment":" ","type":"(value1 -> value2 -> value3 -> value4 -> value5 -> value6 -> valueCombined) -> Pages.StaticHttp.Request value1 -> Pages.StaticHttp.Request value2 -> Pages.StaticHttp.Request value3 -> Pages.StaticHttp.Request value4 -> Pages.StaticHttp.Request value5 -> Pages.StaticHttp.Request value6 -> Pages.StaticHttp.Request valueCombined"},{"name":"map7","comment":" ","type":"(value1 -> value2 -> value3 -> value4 -> value5 -> value6 -> value7 -> valueCombined) -> Pages.StaticHttp.Request value1 -> Pages.StaticHttp.Request value2 -> Pages.StaticHttp.Request value3 -> Pages.StaticHttp.Request value4 -> Pages.StaticHttp.Request value5 -> Pages.StaticHttp.Request value6 -> Pages.StaticHttp.Request value7 -> Pages.StaticHttp.Request valueCombined"},{"name":"map8","comment":" ","type":"(value1 -> value2 -> value3 -> value4 -> value5 -> value6 -> value7 -> value8 -> valueCombined) -> Pages.StaticHttp.Request value1 -> Pages.StaticHttp.Request value2 -> Pages.StaticHttp.Request value3 -> Pages.StaticHttp.Request value4 -> Pages.StaticHttp.Request value5 -> Pages.StaticHttp.Request value6 -> Pages.StaticHttp.Request value7 -> Pages.StaticHttp.Request value8 -> Pages.StaticHttp.Request valueCombined"},{"name":"map9","comment":" ","type":"(value1 -> value2 -> value3 -> value4 -> value5 -> value6 -> value7 -> value8 -> value9 -> valueCombined) -> Pages.StaticHttp.Request value1 -> Pages.StaticHttp.Request value2 -> Pages.StaticHttp.Request value3 -> Pages.StaticHttp.Request value4 -> Pages.StaticHttp.Request value5 -> Pages.StaticHttp.Request value6 -> Pages.StaticHttp.Request value7 -> Pages.StaticHttp.Request value8 -> Pages.StaticHttp.Request value9 -> Pages.StaticHttp.Request valueCombined"},{"name":"request","comment":" Build a `StaticHttp` request (analagous to [Http.request](https://package.elm-lang.org/packages/elm/http/latest/Http#request)).\nThis function takes in all the details to build a `StaticHttp` request, but you can build your own simplified helper functions\nwith this as a low-level detail, or you can use functions like [StaticHttp.get](#get).\n","type":"Pages.Secrets.Value Pages.StaticHttp.RequestDetails -> OptimizedDecoder.Decoder a -> Pages.StaticHttp.Request a"},{"name":"resolve","comment":" Helper to remove an inner layer of Request wrapping.\n","type":"Pages.StaticHttp.Request (List.List (Pages.StaticHttp.Request value)) -> Pages.StaticHttp.Request (List.List value)"},{"name":"stringBody","comment":" Builds a string body for a StaticHttp request. See [elm/http's `Http.stringBody`](https://package.elm-lang.org/packages/elm/http/latest/Http#stringBody).\n\nNote from the `elm/http` docs:\n\n> The first argument is a [MIME type](https://en.wikipedia.org/wiki/Media_type) of the body. Some servers are strict about this!\n\n","type":"String.String -> String.String -> Pages.StaticHttp.Body"},{"name":"succeed","comment":" This is useful for prototyping with some hardcoded data, or for having a view that doesn't have any StaticHttp data.\n\n import Pages.StaticHttp as StaticHttp\n\n view :\n List ( PagePath Pages.PathKey, Metadata )\n ->\n { path : PagePath Pages.PathKey\n , frontmatter : Metadata\n }\n ->\n StaticHttp.Request\n { view : Model -> View -> { title : String, body : Html Msg }\n , head : List (Head.Tag Pages.PathKey)\n }\n view siteMetadata page =\n StaticHttp.succeed\n { view =\n \\model viewForPage ->\n mainView model viewForPage\n , head = head page.frontmatter\n }\n\n","type":"a -> Pages.StaticHttp.Request a"},{"name":"unoptimizedRequest","comment":" This is an alternative to the other request functions in this module that doesn't perform any optimizations on the\nasset. Be sure to use the optimized versions, like `StaticHttp.request`, if you can. Using those can significantly reduce\nyour asset sizes by removing all unused fields from your JSON.\n\nYou may want to use this function instead if you need XML data or plaintext. Or maybe you're hitting a GraphQL API,\nso you don't need any additional optimization as the payload is already reduced down to exactly what you requested.\n\n","type":"Pages.Secrets.Value Pages.StaticHttp.RequestDetails -> Pages.StaticHttp.Expect a -> Pages.StaticHttp.Request a"}],"binops":[]}] |