2020-06-07 02:10:18 +03:00
|
|
|
module Template.Showcase exposing (Model, Msg, decoder, template)
|
2020-05-20 16:42:52 +03:00
|
|
|
|
|
|
|
import Element exposing (Element)
|
|
|
|
import Head
|
|
|
|
import Head.Seo as Seo
|
2020-05-24 03:03:28 +03:00
|
|
|
import Json.Decode as Decode exposing (Decoder)
|
2020-05-20 16:42:52 +03:00
|
|
|
import Pages exposing (images)
|
2020-05-24 18:52:09 +03:00
|
|
|
import Pages.PagePath as PagePath exposing (PagePath)
|
2020-05-20 16:42:52 +03:00
|
|
|
import Pages.StaticHttp as StaticHttp
|
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-08-23 18:00:49 +03:00
|
|
|
import TemplateMetadata exposing (Showcase)
|
2020-09-17 07:08:12 +03:00
|
|
|
import TemplateType exposing (TemplateType)
|
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
|
|
|
|
|
|
|
|
2020-10-25 18:35:30 +03:00
|
|
|
template : TemplateWithState Showcase StaticData () Msg
|
2020-06-07 02:10:18 +03:00
|
|
|
template =
|
2020-09-24 19:04:15 +03:00
|
|
|
Template.withStaticData
|
|
|
|
{ head = head
|
2020-06-07 02:10:18 +03:00
|
|
|
, staticData = staticData
|
|
|
|
}
|
2020-09-24 19:04:15 +03:00
|
|
|
|> Template.buildNoState { view = view }
|
2020-06-07 02:10:18 +03:00
|
|
|
|
|
|
|
|
2020-05-27 22:58:11 +03:00
|
|
|
decoder : Decoder Showcase
|
2020-05-24 03:03:28 +03:00
|
|
|
decoder =
|
2020-05-27 22:58:11 +03:00
|
|
|
Decode.succeed Showcase
|
2020-05-24 03:03:28 +03:00
|
|
|
|
|
|
|
|
2020-09-06 23:03:46 +03:00
|
|
|
staticData :
|
2020-09-17 07:08:12 +03:00
|
|
|
List ( PagePath Pages.PathKey, TemplateType )
|
2020-09-06 23:03:46 +03:00
|
|
|
-> StaticHttp.Request StaticData
|
2020-05-24 18:52:09 +03:00
|
|
|
staticData siteMetadata =
|
|
|
|
Showcase.staticRequest
|
2020-05-20 16:42:52 +03:00
|
|
|
|
2020-05-24 18:52:09 +03:00
|
|
|
|
|
|
|
type alias StaticData =
|
|
|
|
List Showcase.Entry
|
|
|
|
|
|
|
|
|
2020-08-25 07:56:38 +03:00
|
|
|
view :
|
2020-09-17 07:08:12 +03:00
|
|
|
List ( PagePath Pages.PathKey, TemplateType )
|
2020-09-06 18:37:59 +03:00
|
|
|
-> StaticPayload Showcase StaticData
|
2020-09-12 19:15:24 +03:00
|
|
|
-> Shared.RenderedBody
|
|
|
|
-> Shared.PageView msg
|
2020-09-06 18:37:59 +03:00
|
|
|
view allMetadata static rendered =
|
2020-05-24 18:52:09 +03:00
|
|
|
{ title = "elm-pages blog"
|
|
|
|
, body =
|
2020-10-25 01:46:01 +03:00
|
|
|
[ Element.column [ Element.width Element.fill ]
|
2020-09-06 18:37:59 +03:00
|
|
|
[ Element.column [ Element.padding 20, Element.centerX ] [ Showcase.view static.static ]
|
2020-05-24 18:52:09 +03:00
|
|
|
]
|
2020-10-25 01:46:01 +03:00
|
|
|
]
|
2020-05-20 16:42:52 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-09-06 22:42:05 +03:00
|
|
|
head : StaticPayload Showcase StaticData -> List (Head.Tag Pages.PathKey)
|
|
|
|
head staticPayload =
|
2020-05-24 18:52:09 +03:00
|
|
|
Seo.summary
|
|
|
|
{ canonicalUrlOverride = Nothing
|
|
|
|
, siteName = "elm-pages"
|
|
|
|
, image =
|
|
|
|
{ url = images.iconPng
|
|
|
|
, 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
|