mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2025-01-03 17:31:58 +03:00
Correctly generate prerenderrc paths.
This commit is contained in:
parent
f0b98c8d63
commit
80a7ff4769
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
node_modules/
|
||||
elm-stuff/
|
||||
dist/
|
||||
.cache/
|
@ -30,10 +30,26 @@ prerenderRcFormattedPath pageOrPost =
|
||||
pageOrPost.path
|
||||
|> String.dropRight 4
|
||||
|> String.split "/"
|
||||
|> dropIndexFromLast
|
||||
|> List.drop 1
|
||||
|> String.join "/"
|
||||
|
||||
|
||||
dropIndexFromLast : List String -> List String
|
||||
dropIndexFromLast path =
|
||||
path
|
||||
|> List.reverse
|
||||
|> (\reversePath ->
|
||||
case List.head reversePath of
|
||||
Just "index" ->
|
||||
reversePath |> List.drop 1
|
||||
|
||||
_ ->
|
||||
reversePath
|
||||
)
|
||||
|> List.reverse
|
||||
|
||||
|
||||
preRenderRc : Extras -> String
|
||||
preRenderRc extras =
|
||||
(extras.pages ++ extras.posts)
|
||||
|
8527
package-lock.json
generated
Normal file
8527
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -1 +1 @@
|
||||
["_pages/about.emu", "_pages/articles/index.emu", "_posts/articles/moving-faster-with-tiny-steps.emu"]
|
||||
["about", "articles", "articles/moving-faster-with-tiny-steps"]
|
Loading…
Reference in New Issue
Block a user