mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-24 06:54:03 +03:00
Replace some instances of the old Builder module.
This commit is contained in:
parent
602a03eaf0
commit
279e2c60ce
@ -22,7 +22,6 @@ import MarkdownRenderer
|
||||
import Metadata exposing (Metadata)
|
||||
import MySitemap
|
||||
import Pages exposing (images, pages)
|
||||
import Pages.Builder
|
||||
import Pages.Directory as Directory exposing (Directory)
|
||||
import Pages.ImagePath as ImagePath exposing (ImagePath)
|
||||
import Pages.Manifest as Manifest
|
||||
@ -59,7 +58,7 @@ type alias View =
|
||||
|
||||
main : Pages.Platform.Program Model Msg Metadata View
|
||||
main =
|
||||
Pages.Builder.init
|
||||
Pages.Platform.init
|
||||
{ init = init
|
||||
, view = view
|
||||
, update = update
|
||||
@ -73,7 +72,7 @@ main =
|
||||
, canonicalSiteUrl = canonicalSiteUrl
|
||||
, internals = Pages.internals
|
||||
}
|
||||
|> Pages.Builder.withPageChangeMsg OnPageChange
|
||||
|> Pages.Platform.withPageChangeMsg OnPageChange
|
||||
|> RssPlugin.generate
|
||||
{ siteTagline = siteTagline
|
||||
, siteUrl = canonicalSiteUrl
|
||||
@ -83,7 +82,7 @@ main =
|
||||
}
|
||||
metadataToRssItem
|
||||
|> MySitemap.install { siteUrl = canonicalSiteUrl } metadataToSitemapEntry
|
||||
|> Pages.Builder.toApplication
|
||||
|> Pages.Platform.toProgram
|
||||
|
||||
|
||||
metadataToRssItem :
|
||||
|
@ -1,10 +1,8 @@
|
||||
module MySitemap exposing (..)
|
||||
module MySitemap exposing (install)
|
||||
|
||||
import Head
|
||||
import Metadata exposing (Metadata(..))
|
||||
import Pages
|
||||
import Pages.Builder as Builder exposing (Builder)
|
||||
import Pages.PagePath as PagePath exposing (PagePath)
|
||||
import Pages.Platform exposing (Builder)
|
||||
import Pages.StaticHttp as StaticHttp
|
||||
import Sitemap
|
||||
|
||||
@ -14,8 +12,8 @@ install :
|
||||
}
|
||||
->
|
||||
(List
|
||||
{ path : PagePath Pages.PathKey
|
||||
, frontmatter : Metadata
|
||||
{ path : PagePath pathKey
|
||||
, frontmatter : metadata
|
||||
, body : String
|
||||
}
|
||||
-> List { path : String, lastMod : Maybe String }
|
||||
@ -24,8 +22,8 @@ install :
|
||||
-> Builder pathKey userModel userMsg metadata view builderState
|
||||
install config toSitemapEntry builder =
|
||||
builder
|
||||
|> Builder.addGlobalHeadTags [ Head.sitemapLink "/sitemap.xml" ]
|
||||
|> Builder.withFileGenerator
|
||||
|> Pages.Platform.addGlobalHeadTags [ Head.sitemapLink "/sitemap.xml" ]
|
||||
|> Pages.Platform.withFileGenerator
|
||||
(\siteMetadata ->
|
||||
StaticHttp.succeed
|
||||
[ Ok
|
||||
|
@ -1,8 +1,8 @@
|
||||
module RssPlugin exposing (..)
|
||||
module RssPlugin exposing (generate)
|
||||
|
||||
import Head
|
||||
import Pages.Builder exposing (Builder)
|
||||
import Pages.PagePath as PagePath exposing (PagePath)
|
||||
import Pages.Platform exposing (Builder)
|
||||
import Pages.StaticHttp as StaticHttp
|
||||
import Rss
|
||||
import Time
|
||||
@ -33,7 +33,7 @@ generate options metadataToRssItem builder =
|
||||
++ [ "feed.xml" ]
|
||||
in
|
||||
builder
|
||||
|> Pages.Builder.withFileGenerator
|
||||
|> Pages.Platform.withFileGenerator
|
||||
(\siteMetadata ->
|
||||
{ path = feedFilePath
|
||||
, content =
|
||||
@ -53,4 +53,4 @@ generate options metadataToRssItem builder =
|
||||
|> List.singleton
|
||||
|> StaticHttp.succeed
|
||||
)
|
||||
|> Pages.Builder.addGlobalHeadTags [ Head.rssLink (feedFilePath |> String.join "/") ]
|
||||
|> Pages.Platform.addGlobalHeadTags [ Head.rssLink (feedFilePath |> String.join "/") ]
|
||||
|
@ -54,7 +54,6 @@ import Pages.Platform
|
||||
import Pages.Manifest exposing (DisplayMode, Orientation)
|
||||
import Pages.Manifest.Category as Category exposing (Category)
|
||||
import Url.Parser as Url exposing ((</>), s)
|
||||
import Pages.Document as Document
|
||||
import Pages.ImagePath as ImagePath exposing (ImagePath)
|
||||
import Pages.PagePath as PagePath exposing (PagePath)
|
||||
import Pages.Directory as Directory exposing (Directory)
|
||||
@ -121,7 +120,6 @@ import Pages.Platform
|
||||
import Pages.Manifest exposing (DisplayMode, Orientation)
|
||||
import Pages.Manifest.Category as Category exposing (Category)
|
||||
import Url.Parser as Url exposing ((</>), s)
|
||||
import Pages.Document as Document
|
||||
import Pages.ImagePath as ImagePath exposing (ImagePath)
|
||||
import Pages.PagePath as PagePath exposing (PagePath)
|
||||
import Pages.Directory as Directory exposing (Directory)
|
||||
|
Loading…
Reference in New Issue
Block a user