From 094e905dd59702cc128e9d8b2fd43de4b989c75b Mon Sep 17 00:00:00 2001 From: Dillon Kearns Date: Wed, 16 Feb 2022 16:54:52 -0800 Subject: [PATCH] Update pokedex example for latest file structure with app/ folder. --- examples/pokedex/{src => app}/Api.elm | 2 +- .../pokedex/{src => app}/Page/FileUpload.elm | 0 examples/pokedex/{src => app}/Page/Form.elm | 0 .../pokedex/{src => app}/Page/FormEvent.elm | 0 examples/pokedex/{src => app}/Page/Greet.elm | 0 .../pokedex/{src => app}/Page/Hex/Hex_.elm | 0 examples/pokedex/{src => app}/Page/Index.elm | 0 examples/pokedex/{src => app}/Page/Login.elm | 0 .../pokedex/{src => app}/Page/Named/Color_.elm | 0 .../{src => app}/Page/PokedexNumber_.elm | 0 .../{src => app}/Page/RedirectLinks.elm | 0 .../Page/Rgb/Red_/Green_/Blue_.elm | 0 examples/pokedex/{src => app}/Page/Secret.elm | 0 .../pokedex/{src => app}/Page/TailwindForm.elm | 0 examples/pokedex/{src => app}/Page/Time.elm | 0 examples/pokedex/{src => app}/Page/Todos.elm | 0 examples/pokedex/{src => app}/Shared.elm | 0 examples/pokedex/{src => app}/Site.elm | 18 ++++++------------ examples/pokedex/{src => app}/View.elm | 0 examples/pokedex/elm.json | 1 + 20 files changed, 8 insertions(+), 13 deletions(-) rename examples/pokedex/{src => app}/Api.elm (99%) rename examples/pokedex/{src => app}/Page/FileUpload.elm (100%) rename examples/pokedex/{src => app}/Page/Form.elm (100%) rename examples/pokedex/{src => app}/Page/FormEvent.elm (100%) rename examples/pokedex/{src => app}/Page/Greet.elm (100%) rename examples/pokedex/{src => app}/Page/Hex/Hex_.elm (100%) rename examples/pokedex/{src => app}/Page/Index.elm (100%) rename examples/pokedex/{src => app}/Page/Login.elm (100%) rename examples/pokedex/{src => app}/Page/Named/Color_.elm (100%) rename examples/pokedex/{src => app}/Page/PokedexNumber_.elm (100%) rename examples/pokedex/{src => app}/Page/RedirectLinks.elm (100%) rename examples/pokedex/{src => app}/Page/Rgb/Red_/Green_/Blue_.elm (100%) rename examples/pokedex/{src => app}/Page/Secret.elm (100%) rename examples/pokedex/{src => app}/Page/TailwindForm.elm (100%) rename examples/pokedex/{src => app}/Page/Time.elm (100%) rename examples/pokedex/{src => app}/Page/Todos.elm (100%) rename examples/pokedex/{src => app}/Shared.elm (100%) rename examples/pokedex/{src => app}/Site.elm (76%) rename examples/pokedex/{src => app}/View.elm (100%) diff --git a/examples/pokedex/src/Api.elm b/examples/pokedex/app/Api.elm similarity index 99% rename from examples/pokedex/src/Api.elm rename to examples/pokedex/app/Api.elm index 9afb0dd5..143cd22e 100644 --- a/examples/pokedex/src/Api.elm +++ b/examples/pokedex/app/Api.elm @@ -29,7 +29,7 @@ routes getStaticRoutes htmlToString = , greet , fileLength , jsonError - , manifest |> Manifest.generator Site.canonicalUrl + , DataSource.succeed manifest |> Manifest.generator Site.canonicalUrl ] diff --git a/examples/pokedex/src/Page/FileUpload.elm b/examples/pokedex/app/Page/FileUpload.elm similarity index 100% rename from examples/pokedex/src/Page/FileUpload.elm rename to examples/pokedex/app/Page/FileUpload.elm diff --git a/examples/pokedex/src/Page/Form.elm b/examples/pokedex/app/Page/Form.elm similarity index 100% rename from examples/pokedex/src/Page/Form.elm rename to examples/pokedex/app/Page/Form.elm diff --git a/examples/pokedex/src/Page/FormEvent.elm b/examples/pokedex/app/Page/FormEvent.elm similarity index 100% rename from examples/pokedex/src/Page/FormEvent.elm rename to examples/pokedex/app/Page/FormEvent.elm diff --git a/examples/pokedex/src/Page/Greet.elm b/examples/pokedex/app/Page/Greet.elm similarity index 100% rename from examples/pokedex/src/Page/Greet.elm rename to examples/pokedex/app/Page/Greet.elm diff --git a/examples/pokedex/src/Page/Hex/Hex_.elm b/examples/pokedex/app/Page/Hex/Hex_.elm similarity index 100% rename from examples/pokedex/src/Page/Hex/Hex_.elm rename to examples/pokedex/app/Page/Hex/Hex_.elm diff --git a/examples/pokedex/src/Page/Index.elm b/examples/pokedex/app/Page/Index.elm similarity index 100% rename from examples/pokedex/src/Page/Index.elm rename to examples/pokedex/app/Page/Index.elm diff --git a/examples/pokedex/src/Page/Login.elm b/examples/pokedex/app/Page/Login.elm similarity index 100% rename from examples/pokedex/src/Page/Login.elm rename to examples/pokedex/app/Page/Login.elm diff --git a/examples/pokedex/src/Page/Named/Color_.elm b/examples/pokedex/app/Page/Named/Color_.elm similarity index 100% rename from examples/pokedex/src/Page/Named/Color_.elm rename to examples/pokedex/app/Page/Named/Color_.elm diff --git a/examples/pokedex/src/Page/PokedexNumber_.elm b/examples/pokedex/app/Page/PokedexNumber_.elm similarity index 100% rename from examples/pokedex/src/Page/PokedexNumber_.elm rename to examples/pokedex/app/Page/PokedexNumber_.elm diff --git a/examples/pokedex/src/Page/RedirectLinks.elm b/examples/pokedex/app/Page/RedirectLinks.elm similarity index 100% rename from examples/pokedex/src/Page/RedirectLinks.elm rename to examples/pokedex/app/Page/RedirectLinks.elm diff --git a/examples/pokedex/src/Page/Rgb/Red_/Green_/Blue_.elm b/examples/pokedex/app/Page/Rgb/Red_/Green_/Blue_.elm similarity index 100% rename from examples/pokedex/src/Page/Rgb/Red_/Green_/Blue_.elm rename to examples/pokedex/app/Page/Rgb/Red_/Green_/Blue_.elm diff --git a/examples/pokedex/src/Page/Secret.elm b/examples/pokedex/app/Page/Secret.elm similarity index 100% rename from examples/pokedex/src/Page/Secret.elm rename to examples/pokedex/app/Page/Secret.elm diff --git a/examples/pokedex/src/Page/TailwindForm.elm b/examples/pokedex/app/Page/TailwindForm.elm similarity index 100% rename from examples/pokedex/src/Page/TailwindForm.elm rename to examples/pokedex/app/Page/TailwindForm.elm diff --git a/examples/pokedex/src/Page/Time.elm b/examples/pokedex/app/Page/Time.elm similarity index 100% rename from examples/pokedex/src/Page/Time.elm rename to examples/pokedex/app/Page/Time.elm diff --git a/examples/pokedex/src/Page/Todos.elm b/examples/pokedex/app/Page/Todos.elm similarity index 100% rename from examples/pokedex/src/Page/Todos.elm rename to examples/pokedex/app/Page/Todos.elm diff --git a/examples/pokedex/src/Shared.elm b/examples/pokedex/app/Shared.elm similarity index 100% rename from examples/pokedex/src/Shared.elm rename to examples/pokedex/app/Shared.elm diff --git a/examples/pokedex/src/Site.elm b/examples/pokedex/app/Site.elm similarity index 76% rename from examples/pokedex/src/Site.elm rename to examples/pokedex/app/Site.elm index 162ee43e..fdcf5394 100644 --- a/examples/pokedex/src/Site.elm +++ b/examples/pokedex/app/Site.elm @@ -1,8 +1,7 @@ module Site exposing (canonicalUrl, config) -import DataSource +import DataSource exposing (DataSource) import Head -import Pages.Manifest as Manifest import Route exposing (Route) import SiteConfig exposing (SiteConfig) import Sitemap @@ -12,10 +11,9 @@ type alias Data = () -config : SiteConfig Data +config : SiteConfig config = - { data = data - , canonicalUrl = canonicalUrl + { canonicalUrl = canonicalUrl , head = head } @@ -25,15 +23,11 @@ canonicalUrl = "https://elm-pages.com" -data : DataSource.DataSource Data -data = - DataSource.succeed () - - -head : Data -> List Head.Tag -head static = +head : DataSource (List Head.Tag) +head = [ Head.sitemapLink "/sitemap.xml" ] + |> DataSource.succeed siteMap : diff --git a/examples/pokedex/src/View.elm b/examples/pokedex/app/View.elm similarity index 100% rename from examples/pokedex/src/View.elm rename to examples/pokedex/app/View.elm diff --git a/examples/pokedex/elm.json b/examples/pokedex/elm.json index a6e31e99..eb1e59e7 100644 --- a/examples/pokedex/elm.json +++ b/examples/pokedex/elm.json @@ -2,6 +2,7 @@ "type": "application", "source-directories": [ "src", + "app", "../../src", ".elm-pages", "../../plugins",