HTML in a template variable #19186
-
I am using vweb to create a website. the variable <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>${title}</title>
@css '/templates/page/dark.css'
</head>
<body>
<h1>Review of ${post.first().name}</h1>
<p>${post.first().desc}</p>
<p>Posted at ${post.first().time} by ${admin}</p>
<h2>This thing got ${post.first().rating} out of 10 stars!</h2>
<hr></hr>
$post.first().rating_message
@include 'footer'
</body>
</html> See in the image below that the HTML is not being rendered. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Okay, after doing some trickery I found a solution. Maybe there should be a feature implemented so there is a way to do this with |
Beta Was this translation helpful? Give feedback.
-
In your HTML template you can do
|
Beta Was this translation helpful? Give feedback.
Okay, after doing some trickery I found a solution.
Instead of using
return $vweb.html()
like you usually do, I instead didreturn app.html($tmpl("templates/page/view.html"))
.Maybe there should be a feature implemented so there is a way to do this with
$vweb.html
?