2021-04-15 23:40:36 +03:00
|
|
|
module Template.Showcase exposing (Model, Msg, StaticData, template)
|
2020-05-20 16:42:52 +03:00
|
|
|
|
2021-04-20 17:31:19 +03:00
|
|
|
import DataSource
|
2021-04-13 02:54:08 +03:00
|
|
|
import Document exposing (Document)
|
2020-05-20 16:42:52 +03:00
|
|
|
import Element exposing (Element)
|
|
|
|
import Head
|
|
|
|
import Head.Seo as Seo
|
2021-04-10 22:57:58 +03:00
|
|
|
import Pages.ImagePath as ImagePath
|
2020-09-12 19:15:24 +03:00
|
|
|
import Shared
|
2020-05-20 16:42:52 +03:00
|
|
|
import Showcase
|
2020-10-25 18:35:30 +03:00
|
|
|
import Template exposing (StaticPayload, TemplateWithState)
|
2020-05-20 16:42:52 +03:00
|
|
|
|
|
|
|
|
2020-08-27 07:14:52 +03:00
|
|
|
type alias Model =
|
|
|
|
()
|
|
|
|
|
|
|
|
|
2020-09-24 19:04:15 +03:00
|
|
|
type alias Msg =
|
|
|
|
Never
|
2020-05-20 16:42:52 +03:00
|
|
|
|
|
|
|
|
2021-04-02 07:23:55 +03:00
|
|
|
template : TemplateWithState {} StaticData () Msg
|
2020-06-07 02:10:18 +03:00
|
|
|
template =
|
2020-09-24 19:04:15 +03:00
|
|
|
Template.withStaticData
|
|
|
|
{ head = head
|
2021-04-20 17:31:19 +03:00
|
|
|
, staticRoutes = DataSource.succeed []
|
2021-04-05 06:47:25 +03:00
|
|
|
, staticData = \_ -> staticData
|
2020-06-07 02:10:18 +03:00
|
|
|
}
|
2020-09-24 19:04:15 +03:00
|
|
|
|> Template.buildNoState { view = view }
|
2020-06-07 02:10:18 +03:00
|
|
|
|
|
|
|
|
2021-04-20 17:45:35 +03:00
|
|
|
staticData : DataSource.DataSource StaticData
|
2021-04-01 22:56:33 +03:00
|
|
|
staticData =
|
2021-04-03 01:47:07 +03:00
|
|
|
Showcase.staticRequest
|
2021-04-01 05:55:28 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--(StaticHttp.get
|
|
|
|
-- (Secrets.succeed "file://elm.json")
|
|
|
|
-- OptimizedDecoder.string
|
|
|
|
--)
|
|
|
|
|
|
|
|
|
|
|
|
type alias DataFromFile =
|
|
|
|
{ body : List (Element Msg), title : String }
|
|
|
|
|
|
|
|
|
2020-05-24 18:52:09 +03:00
|
|
|
type alias StaticData =
|
2021-04-03 01:47:07 +03:00
|
|
|
List Showcase.Entry
|
2020-05-24 18:52:09 +03:00
|
|
|
|
|
|
|
|
2020-08-25 07:56:38 +03:00
|
|
|
view :
|
2021-04-05 17:48:26 +03:00
|
|
|
StaticPayload StaticData {}
|
2021-04-13 02:54:08 +03:00
|
|
|
-> Document Msg
|
2021-04-03 01:21:17 +03:00
|
|
|
view static =
|
2020-05-24 18:52:09 +03:00
|
|
|
{ title = "elm-pages blog"
|
|
|
|
, body =
|
2021-04-01 05:55:28 +03:00
|
|
|
let
|
2021-04-03 01:47:07 +03:00
|
|
|
showcaseEntries =
|
2021-04-01 05:55:28 +03:00
|
|
|
static.static
|
|
|
|
in
|
2020-10-25 01:46:01 +03:00
|
|
|
[ Element.column [ Element.width Element.fill ]
|
2021-04-03 01:47:07 +03:00
|
|
|
[ Element.column [ Element.padding 20, Element.centerX ] [ Showcase.view showcaseEntries ]
|
2020-05-24 18:52:09 +03:00
|
|
|
]
|
2020-10-25 01:46:01 +03:00
|
|
|
]
|
2020-05-20 16:42:52 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-04-10 23:51:39 +03:00
|
|
|
head : StaticPayload StaticData {} -> List Head.Tag
|
2020-09-06 22:42:05 +03:00
|
|
|
head staticPayload =
|
2020-05-24 18:52:09 +03:00
|
|
|
Seo.summary
|
|
|
|
{ canonicalUrlOverride = Nothing
|
|
|
|
, siteName = "elm-pages"
|
|
|
|
, image =
|
2021-04-10 22:57:58 +03:00
|
|
|
{ url = ImagePath.build [ "images", "icon-png.png" ]
|
2020-05-24 18:52:09 +03:00
|
|
|
, alt = "elm-pages logo"
|
|
|
|
, dimensions = Nothing
|
|
|
|
, mimeType = Nothing
|
|
|
|
}
|
|
|
|
, description = "See some neat sites built using elm-pages! (Or submit yours!)"
|
|
|
|
, locale = Nothing
|
|
|
|
, title = "elm-pages sites showcase"
|
|
|
|
}
|
|
|
|
|> Seo.website
|