2022-02-14 22:01:46 +03:00
|
|
|
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)
|
2020-10-24 23:02:17 +03:00
|
|
|
import Cloudinary
|
2022-12-29 04:45:49 +03:00
|
|
|
import Exception exposing (Throwable)
|
2021-04-05 20:02:27 +03:00
|
|
|
import Head
|
2020-10-24 23:02:17 +03:00
|
|
|
import MimeType
|
2021-05-24 01:11:46 +03:00
|
|
|
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
|
|
|
|
2022-02-14 22:01:46 +03:00
|
|
|
config : SiteConfig
|
2021-04-13 23:05:33 +03:00
|
|
|
config =
|
2022-02-14 22:01:46 +03:00
|
|
|
{ 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)
|
2022-02-14 22:01:46 +03:00
|
|
|
head =
|
2022-10-29 16:24:03 +03:00
|
|
|
[ 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
|
2020-09-13 18:02:35 +03:00
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
2020-10-24 23:02:17 +03:00
|
|
|
cloudinaryIcon :
|
|
|
|
MimeType.MimeImage
|
|
|
|
-> Int
|
2021-05-24 01:11:46 +03:00
|
|
|
-> Pages.Url.Url
|
2020-10-24 23:02:17 +03:00
|
|
|
cloudinaryIcon mimeType width =
|
|
|
|
Cloudinary.urlSquare "v1603234028/elm-pages/elm-pages-icon" (Just mimeType) width
|