+++ /dev/null
-<!DOCTYPE html>
-<html>
-
-<head>
- <title>Today Engine Examples</title>
- <link rel="stylesheet" href="/style.css">
-</head>
-
-<body>
- <main>
- <stdp-contact-form :action="/contact" id="cf-get"></stdp-contact-form>
- <stdp-contact-form :action="/contact" :method="POST" id="cf-post"></stdp-contact-form>
-
- {{- range $i, $v := SliceOfLen 5 }}
- <test-thing :value="."></test-thing>
- {{ end -}}
- </main>
-</body>
-
-</html>
\ No newline at end of file
}),
)
-var Page = page.New("index", "index.html",
+var Page = page.New("index", "pages/index.html",
page.Includes(
stdpart.ContactForm([]string{"Feedback"}), Thing,
),
return out
},
}),
- page.Pretty(" "),
)
+var Static = page.Static("pages/static.html")
+
func main() {
app := tapp.New()
tapp.GetEnv().Apply(app)
app.ShutdownOnSignal(syscall.SIGINT, syscall.SIGTERM)
app.Handle("GET /{$}", Page)
+ app.Handle("GET /static", Static)
app.Handle("GET /", http.FileServer(http.Dir("public")))
app.Handle("GET /contact", stdpart.HandleContactForm(nil, stdpart.PrintContact))
app.Handle("POST /contact", stdpart.HandleContactForm(nil, stdpart.PrintContact))
--- /dev/null
+<!DOCTYPE html>
+<html>
+
+<head>
+ <title>Today Engine Examples</title>
+ <link rel="stylesheet" href="/style.css">
+</head>
+
+<body>
+ <main>
+ <stdp-contact-form :action="/contact" id="cf-get"></stdp-contact-form>
+ <stdp-contact-form :action="/contact" :method="POST" id="cf-post"></stdp-contact-form>
+
+ {{- range $i, $v := SliceOfLen 5 }}
+ <test-thing :value="."></test-thing>
+ {{ end -}}
+
+ <a href="/static">Link to static page</a>
+ </main>
+</body>
+
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>
+<html>
+
+<head>
+ <title>Today Engine Examples</title>
+ <link rel="stylesheet" href="/style.css">
+</head>
+
+<body>
+ <main>
+ <h1>This is a normal static page.</h1>
+ <p>It doesn't do anything except exist. Neat.</p>
+ </main>
+</body>
+
+</html>
\ No newline at end of file