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

57 lines
1.2 KiB
Elm
Raw Normal View History

2021-04-06 00:25:37 +03:00
module Site exposing (config)
2020-05-24 01:31:56 +03:00
import Cloudinary
import DataSource exposing (DataSource)
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
2021-04-24 02:22:23 +03:00
config : SiteConfig Data
2021-04-13 23:05:33 +03:00
config =
2021-08-01 20:25:38 +03:00
{ data = data
, canonicalUrl = canonicalUrl
, head = head
}
2021-04-13 23:05:33 +03:00
2021-04-24 02:22:23 +03:00
type alias Data =
String
2020-09-13 17:19:09 +03:00
2021-04-24 02:22:23 +03:00
data : DataSource.DataSource Data
data =
--DataSource.File.rawFile "hello.txt"
DataSource.succeed "hello"
2021-04-05 20:02:27 +03:00
2021-04-24 02:22:23 +03:00
head : Data -> List Head.Tag
2021-04-05 20:02:27 +03:00
head static =
[ Head.icon [ ( 32, 32 ) ] MimeType.Png (cloudinaryIcon MimeType.Png 32)
, 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)
2021-05-22 21:53:14 +03:00
, Head.rssLink "/blog/feed.xml"
2021-04-14 05:20:10 +03:00
, Head.sitemapLink "/sitemap.xml"
, Head.manifestLink "manifest.json"
2021-04-05 20:02:27 +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-05-24 18:36:40 +03:00
tagline : String
tagline =
2021-05-29 21:42:43 +03:00
"pull in typed elm data to your pages"
cloudinaryIcon :
MimeType.MimeImage
-> Int
-> Pages.Url.Url
cloudinaryIcon mimeType width =
Cloudinary.urlSquare "v1603234028/elm-pages/elm-pages-icon" (Just mimeType) width