elm-pages-v3-beta/examples/docs/app/Site.elm

45 lines
1.3 KiB
Elm
Raw Normal View History

module Site exposing (canonicalUrl, config)
2020-05-24 01:31:56 +03:00
2023-01-02 01:44:11 +03:00
import BackendTask exposing (BackendTask)
import Cloudinary
2022-12-29 04:45:49 +03:00
import Exception exposing (Throwable)
2021-04-05 20:02:27 +03:00
import Head
import MimeType
import Pages.Url
2021-04-14 04:43:31 +03:00
import SiteConfig exposing (SiteConfig)
2020-05-24 03:03:28 +03:00
2020-05-24 01:31:56 +03:00
config : SiteConfig
2021-04-13 23:05:33 +03:00
config =
{ canonicalUrl = canonicalUrl
2021-08-01 20:25:38 +03:00
, head = head
}
2021-04-13 23:05:33 +03:00
2023-01-02 01:44:11 +03:00
head : BackendTask Throwable (List Head.Tag)
head =
[ Head.metaName "viewport" (Head.raw "width=device-width,initial-scale=1")
, Head.metaName "mobile-web-app-capable" (Head.raw "yes")
, Head.metaName "theme-color" (Head.raw "#ffffff")
, Head.metaName "apple-mobile-web-app-capable" (Head.raw "yes")
, Head.metaName "apple-mobile-web-app-status-bar-style" (Head.raw "black-translucent")
, Head.icon [ ( 32, 32 ) ] MimeType.Png (cloudinaryIcon MimeType.Png 32)
2021-04-05 20:02:27 +03:00
, Head.icon [ ( 16, 16 ) ] MimeType.Png (cloudinaryIcon MimeType.Png 16)
, Head.appleTouchIcon (Just 180) (cloudinaryIcon MimeType.Png 180)
, Head.appleTouchIcon (Just 192) (cloudinaryIcon MimeType.Png 192)
]
2023-01-02 01:44:11 +03:00
|> BackendTask.succeed
2021-04-14 05:20:10 +03:00
canonicalUrl : String
canonicalUrl =
2020-05-24 01:31:56 +03:00
"https://elm-pages.com"
2020-05-24 03:03:28 +03:00
cloudinaryIcon :
MimeType.MimeImage
-> Int
-> Pages.Url.Url
cloudinaryIcon mimeType width =
Cloudinary.urlSquare "v1603234028/elm-pages/elm-pages-icon" (Just mimeType) width