mirror of
https://github.com/dillonkearns/elm-pages.git
synced 2024-09-11 09:05:28 +03:00
Update base-path example.
This commit is contained in:
parent
84fe59f9c7
commit
0e1ccd8e3b
@ -1,4 +1,4 @@
|
||||
module Page.Index exposing (Data, Model, Msg, page)
|
||||
module Route.Index exposing (Data, Model, Msg, route)
|
||||
|
||||
import DataSource exposing (DataSource)
|
||||
import DataSource.File
|
||||
@ -20,15 +20,15 @@ type alias Model =
|
||||
|
||||
|
||||
type alias Msg =
|
||||
Never
|
||||
()
|
||||
|
||||
|
||||
type alias RouteParams =
|
||||
{}
|
||||
|
||||
|
||||
page : StatelessRoute RouteParams Data
|
||||
page =
|
||||
route : StatelessRoute RouteParams Data
|
||||
route =
|
||||
RouteBuilder.single
|
||||
{ head = head
|
||||
, data = data
|
@ -1,4 +1,4 @@
|
||||
module Page.SubPage exposing (Data, Model, Msg, page)
|
||||
module Route.SubPage exposing (Data, Model, Msg, route)
|
||||
|
||||
import Css exposing (..)
|
||||
import Css.Global
|
||||
@ -8,10 +8,10 @@ import Head
|
||||
import Head.Seo as Seo
|
||||
import Html.Styled as Html exposing (..)
|
||||
import Html.Styled.Attributes as Attr
|
||||
import RouteBuilder exposing (StatelessRoute, StatefulRoute, StaticPayload)
|
||||
import Pages.PageUrl exposing (PageUrl)
|
||||
import Pages.Url
|
||||
import Path
|
||||
import RouteBuilder exposing (StatefulRoute, StatelessRoute, StaticPayload)
|
||||
import Shared
|
||||
import View exposing (View)
|
||||
|
||||
@ -21,15 +21,15 @@ type alias Model =
|
||||
|
||||
|
||||
type alias Msg =
|
||||
Never
|
||||
()
|
||||
|
||||
|
||||
type alias RouteParams =
|
||||
{}
|
||||
|
||||
|
||||
page : StatelessRoute RouteParams Data
|
||||
page =
|
||||
route : StatelessRoute RouteParams Data
|
||||
route =
|
||||
RouteBuilder.single
|
||||
{ head = head
|
||||
, data = data
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"type": "application",
|
||||
"source-directories": [
|
||||
"app",
|
||||
"src",
|
||||
"../../src",
|
||||
".elm-pages",
|
||||
@ -11,36 +12,41 @@
|
||||
"direct": {
|
||||
"MartinSStewart/elm-serialize": "1.2.5",
|
||||
"avh4/elm-color": "1.0.0",
|
||||
"danfishgold/base64-bytes": "1.1.0",
|
||||
"danyx23/elm-mimetype": "4.0.1",
|
||||
"dillonkearns/elm-bcp47-language-tag": "1.0.1",
|
||||
"dillonkearns/elm-markdown": "6.0.1",
|
||||
"elm/browser": "1.0.2",
|
||||
"elm/bytes": "1.0.8",
|
||||
"elm/core": "1.0.5",
|
||||
"elm/html": "1.0.0",
|
||||
"elm/http": "2.0.0",
|
||||
"elm/json": "1.1.3",
|
||||
"elm/parser": "1.1.0",
|
||||
"elm/regex": "1.0.0",
|
||||
"elm/time": "1.0.0",
|
||||
"elm/url": "1.0.0",
|
||||
"elm/virtual-dom": "1.0.2",
|
||||
"elm-community/dict-extra": "2.4.0",
|
||||
"elm-community/list-extra": "8.3.0",
|
||||
"jluckyiv/elm-utc-date-strings": "1.0.0",
|
||||
"lamdera/codecs": "1.0.0",
|
||||
"lamdera/core": "1.0.0",
|
||||
"matheus23/elm-default-tailwind-modules": "2.0.1",
|
||||
"miniBill/elm-codec": "2.0.0",
|
||||
"noahzgordon/elm-color-extra": "1.0.2",
|
||||
"pablohirafuji/elm-syntax-highlight": "3.4.0",
|
||||
"robinheghan/fnv1a": "1.0.0",
|
||||
"robinheghan/murmur3": "1.0.0",
|
||||
"rtfeldman/elm-css": "16.1.1",
|
||||
"tripokey/elm-fuzzy": "5.2.1",
|
||||
"turboMaCk/non-empty-list-alias": "1.2.0",
|
||||
"vito/elm-ansi": "10.0.1",
|
||||
"zwilias/json-decode-exploration": "6.0.0"
|
||||
},
|
||||
"indirect": {
|
||||
"bburdette/toop": "1.0.1",
|
||||
"danfishgold/base64-bytes": "1.1.0",
|
||||
"elm/bytes": "1.0.8",
|
||||
"elm/file": "1.0.5",
|
||||
"elm/parser": "1.1.0",
|
||||
"elm/random": "1.0.0",
|
||||
"fredcy/elm-parseint": "2.0.1",
|
||||
"mgold/elm-nonempty-list": "4.2.0",
|
||||
|
34
examples/base-path/package-lock.json
generated
34
examples/base-path/package-lock.json
generated
@ -21,23 +21,28 @@
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"chokidar": "3.5.2",
|
||||
"busboy": "^1.0.0",
|
||||
"chokidar": "^3.5.3",
|
||||
"commander": "8.3.0",
|
||||
"connect": "^3.7.0",
|
||||
"cookie-signature": "^1.1.0",
|
||||
"cross-spawn": "7.0.3",
|
||||
"devcert": "^1.2.0",
|
||||
"elm-doc-preview": "^5.0.5",
|
||||
"elm-hot": "^1.1.6",
|
||||
"esbuild": "^0.14.23",
|
||||
"fs-extra": "^10.0.0",
|
||||
"globby": "11.0.4",
|
||||
"gray-matter": "^4.0.3",
|
||||
"jsesc": "^3.0.2",
|
||||
"kleur": "^4.1.4",
|
||||
"memfs": "^3.4.1",
|
||||
"micromatch": "^4.0.4",
|
||||
"node-fetch": "^2.6.7",
|
||||
"object-hash": "^2.2.0",
|
||||
"serve-static": "^1.14.1",
|
||||
"terser": "^5.7.2",
|
||||
"undici": "^4.4.7",
|
||||
"terser": "^5.11.0",
|
||||
"vite": "^2.8.4",
|
||||
"which": "^2.0.2"
|
||||
},
|
||||
"bin": {
|
||||
@ -49,12 +54,12 @@
|
||||
"@types/micromatch": "^4.0.2",
|
||||
"@types/node": "12.20.12",
|
||||
"@types/serve-static": "1.13.10",
|
||||
"cypress": "^8.3.0",
|
||||
"cypress": "^9.5.0",
|
||||
"elm-optimize-level-2": "^0.1.5",
|
||||
"elm-review": "^2.5.3",
|
||||
"elm-review": "^2.7.0",
|
||||
"elm-test": "^0.19.1-revision7",
|
||||
"elm-tooling": "^1.3.0",
|
||||
"elm-verify-examples": "^5.0.0",
|
||||
"elm-verify-examples": "^5.2.0",
|
||||
"elmi-to-json": "^1.2.0",
|
||||
"mocha": "^9.1.0",
|
||||
"typescript": "4.3.5"
|
||||
@ -1552,32 +1557,37 @@
|
||||
"@types/micromatch": "^4.0.2",
|
||||
"@types/node": "12.20.12",
|
||||
"@types/serve-static": "1.13.10",
|
||||
"chokidar": "3.5.2",
|
||||
"busboy": "^1.0.0",
|
||||
"chokidar": "^3.5.3",
|
||||
"commander": "8.3.0",
|
||||
"connect": "^3.7.0",
|
||||
"cookie-signature": "^1.1.0",
|
||||
"cross-spawn": "7.0.3",
|
||||
"cypress": "^8.3.0",
|
||||
"cypress": "^9.5.0",
|
||||
"devcert": "^1.2.0",
|
||||
"elm-doc-preview": "^5.0.5",
|
||||
"elm-hot": "^1.1.6",
|
||||
"elm-optimize-level-2": "^0.1.5",
|
||||
"elm-review": "^2.5.3",
|
||||
"elm-review": "^2.7.0",
|
||||
"elm-test": "^0.19.1-revision7",
|
||||
"elm-tooling": "^1.3.0",
|
||||
"elm-verify-examples": "^5.0.0",
|
||||
"elm-verify-examples": "^5.2.0",
|
||||
"elmi-to-json": "^1.2.0",
|
||||
"esbuild": "^0.14.23",
|
||||
"fs-extra": "^10.0.0",
|
||||
"globby": "11.0.4",
|
||||
"gray-matter": "^4.0.3",
|
||||
"jsesc": "^3.0.2",
|
||||
"kleur": "^4.1.4",
|
||||
"memfs": "^3.4.1",
|
||||
"micromatch": "^4.0.4",
|
||||
"mocha": "^9.1.0",
|
||||
"node-fetch": "^2.6.7",
|
||||
"object-hash": "^2.2.0",
|
||||
"serve-static": "^1.14.1",
|
||||
"terser": "^5.7.2",
|
||||
"terser": "^5.11.0",
|
||||
"typescript": "4.3.5",
|
||||
"undici": "^4.4.7",
|
||||
"vite": "^2.8.4",
|
||||
"which": "^2.0.2"
|
||||
},
|
||||
"dependencies": {
|
||||
|
@ -2,12 +2,8 @@ module Api exposing (routes)
|
||||
|
||||
import ApiRoute
|
||||
import DataSource exposing (DataSource)
|
||||
import DataSource.Http
|
||||
import Html exposing (Html)
|
||||
import Json.Encode
|
||||
import OptimizedDecoder as Decode
|
||||
import Route exposing (Route)
|
||||
import Secrets
|
||||
|
||||
|
||||
routes :
|
||||
|
@ -1,19 +1,14 @@
|
||||
module Shared exposing (Data, Model, Msg(..), SharedMsg(..), template)
|
||||
|
||||
import Browser.Navigation
|
||||
import Css.Global
|
||||
import DataSource
|
||||
import DataSource.Http
|
||||
import Html exposing (Html)
|
||||
import Html.Styled
|
||||
import OptimizedDecoder as D
|
||||
import Pages.Flags
|
||||
import Pages.PageUrl exposing (PageUrl)
|
||||
import Path exposing (Path)
|
||||
import Route exposing (Route)
|
||||
import Secrets
|
||||
import SharedTemplate exposing (SharedTemplate)
|
||||
import Tailwind.Utilities
|
||||
import View exposing (View)
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
module Site exposing (config)
|
||||
|
||||
import Cloudinary
|
||||
import DataSource
|
||||
import DataSource exposing (DataSource)
|
||||
import Head
|
||||
import MimeType
|
||||
import Pages.Manifest as Manifest
|
||||
@ -10,11 +10,9 @@ import Route exposing (Route)
|
||||
import SiteConfig exposing (SiteConfig)
|
||||
|
||||
|
||||
config : SiteConfig Data
|
||||
config : SiteConfig
|
||||
config =
|
||||
{ data = data
|
||||
, canonicalUrl = canonicalUrl
|
||||
, manifest = manifest
|
||||
{ canonicalUrl = canonicalUrl
|
||||
, head = head
|
||||
}
|
||||
|
||||
@ -24,21 +22,15 @@ type alias Data =
|
||||
}
|
||||
|
||||
|
||||
data : DataSource.DataSource Data
|
||||
data =
|
||||
DataSource.map Data
|
||||
--(StaticFile.request "site-name.txt" StaticFile.body)
|
||||
(DataSource.succeed "site-name")
|
||||
|
||||
|
||||
head : Data -> List Head.Tag
|
||||
head static =
|
||||
head : DataSource (List Head.Tag)
|
||||
head =
|
||||
[ Head.icon [ ( 32, 32 ) ] MimeType.Png (cloudinaryIcon MimeType.Png 32)
|
||||
, Head.icon [ ( 16, 16 ) ] MimeType.Png (cloudinaryIcon MimeType.Png 16)
|
||||
, Head.appleTouchIcon (Just 180) (cloudinaryIcon MimeType.Png 180)
|
||||
, Head.appleTouchIcon (Just 192) (cloudinaryIcon MimeType.Png 192)
|
||||
, Head.sitemapLink "/sitemap.xml"
|
||||
]
|
||||
|> DataSource.succeed
|
||||
|
||||
|
||||
canonicalUrl : String
|
||||
|
Loading…
Reference in New Issue
Block a user