mirror of
https://github.com/ethauvin/rife2-hello.git
synced 2025-04-25 23:37:12 -07:00
Merge pull request #6 from melix/cc/additional-template-dirs
Add support for extra template directories
This commit is contained in:
commit
de5c974f15
7 changed files with 70 additions and 23 deletions
|
@ -6,6 +6,7 @@ public class App extends Site {
|
|||
public void setup() {
|
||||
var hello = get("/hello", c -> c.print(c.template("hello")));
|
||||
get("/", c -> c.redirect(hello));
|
||||
get("/world", c -> c.print(c.template("world")));
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
@ -13,4 +14,4 @@ public class App extends Site {
|
|||
.staticResourceBase("src/main/webapp")
|
||||
.start(new App());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
11
app/src/main/resources/templates/world.html
Normal file
11
app/src/main/resources/templates/world.html
Normal file
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title><!--v title-->Hello<!--/v--></title>
|
||||
<link rel="stylesheet" href="{{v webapp:rootUrl/}}css/style.css?{{v context:paramRandom/}}">
|
||||
</head>
|
||||
<body>
|
||||
<p>Hello World from src/main/resources/templates</p>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue