mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-28 23:12:22 +03:00
Rename type and pass through.
This commit is contained in:
parent
5b9110bf68
commit
5d1b5e6b76
@ -1,4 +1,4 @@
|
||||
module Content exposing (allData, pages, posts)
|
||||
module Content exposing (Content, allData, pages, posts)
|
||||
|
||||
import Element exposing (Element)
|
||||
import Index
|
||||
@ -8,7 +8,7 @@ import MarkParser
|
||||
import Result.Extra
|
||||
|
||||
|
||||
type alias Data msg =
|
||||
type alias Content msg =
|
||||
{ posts :
|
||||
List
|
||||
( List String
|
||||
@ -26,7 +26,7 @@ type alias Data msg =
|
||||
}
|
||||
|
||||
|
||||
allData : Result (Element msg) (Data msg)
|
||||
allData : Result (Element msg) (Content msg)
|
||||
allData =
|
||||
case posts of
|
||||
Ok postListings ->
|
||||
|
@ -2,7 +2,7 @@ module Main exposing (main)
|
||||
|
||||
import Browser
|
||||
import Browser.Navigation as Nav
|
||||
import Content
|
||||
import Content exposing (Content)
|
||||
import Element exposing (Element)
|
||||
import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
@ -94,14 +94,14 @@ mainView : Url -> Element msg
|
||||
mainView url =
|
||||
case Content.allData of
|
||||
Ok site ->
|
||||
pageView url
|
||||
pageView site url
|
||||
|
||||
Err errorView ->
|
||||
errorView
|
||||
|
||||
|
||||
pageView : Url -> Element msg
|
||||
pageView url =
|
||||
pageView : Content msg -> Url -> Element msg
|
||||
pageView content url =
|
||||
case lookupPage url of
|
||||
Just page ->
|
||||
case Mark.compile (MarkParser.document Element.none) page of
|
||||
|
Loading…
Reference in New Issue
Block a user