Biography example working better.

This commit is contained in:
JesseBrault0709 2024-05-17 15:07:47 +02:00
parent 30e463f1cf
commit 526f01c683
2 changed files with 12 additions and 8 deletions

View File

@ -7,16 +7,11 @@ import jakarta.inject.Inject
@PageSpec(name = 'Biography', path = '/biography')
class Biography extends WvcPageView {
static final String greeting = 'Hello, World!'
@Inject
Biography() {
super(Biography.getResource('BiographyTemplate.wvc'))
println 'Hello from Biography!'
}
@Override
void renderTo(Writer out) throws IOException {
println "Rendering: $pageTitle..."
super.renderTo(out)
}
}

View File

@ -1,4 +1,13 @@
---
package com.jessebrault.site
---
Hello, World!
<html lang="en">
<head>
<title>$pageTitle</title>
</head>
<body>
<h1>$pageTitle</h1>
<h2>$url</h2>
<p>$greeting</p>
</body>
</html>