Correctly generate prerenderrc paths.

This commit is contained in:
Dillon Kearns 2019-07-23 08:57:24 -07:00
parent f0b98c8d63
commit 80a7ff4769
4 changed files with 8548 additions and 1 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
node_modules/
elm-stuff/
dist/
.cache/

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -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"]