Open lukewilliamboswell opened 2 months ago
## Generated by RTL https://github.com/isaacvando/rtl module [ blogPost, home, ] blogPost = \model -> [ """ <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>$(model.post.title |> escapeHtml) - Roc Template Example</title> </head> <body> <div> <h1>$(model.post.title |> escapeHtml)</h1> """, List.map model.post.content \item -> [ """ """, when item is Text t -> """ <p>$(t |> escapeHtml)</p> """ Code c -> """ <pre>$(c |> escapeHtml)</pre> """ Image i -> """ <img src="$(i |> escapeHtml)" width=100> """, """ """, ] |> Str.joinWith "" |> Str.joinWith "", """ <br> <a href="/">Home</a> </div> </body> </html> """, ] |> Str.joinWith "" home = \model -> [ """ <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Roc Template Example Blog</title> </head> <body> <div> <h1>Posts</h1> <ul> """, List.map model.posts \post -> """ <li> <a href="/posts/$(post.slug |> escapeHtml)">$(post.title |> escapeHtml)</a> </li> """ |> Str.joinWith "", """ </ul> </div> </body> </html> """, ] |> Str.joinWith "" escapeHtml : Str -> Str escapeHtml = \input -> input |> Str.replaceEach "&" "&" |> Str.replaceEach "<" "<" |> Str.replaceEach ">" ">" |> Str.replaceEach "\"" """ |> Str.replaceEach "'" "'"
Pages.roc-format--failed