We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
## 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 "'" "'"
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Pages.roc-format--failed
The text was updated successfully, but these errors were encountered: