From 63621d0f9bceb7fa6309076e8c1be1ad37175d25 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Thu, 8 Oct 2020 09:30:57 -0400 Subject: [PATCH] Move Markdown preview page to template --- markdown.html | 70 ----------------------------------------------------- pages/markdown.tmpl | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++ server.go | 1 + 3 files changed, 68 insertions(+), 70 deletions(-) delete mode 100644 markdown.html create mode 100644 pages/markdown.tmpl diff --git a/markdown.html b/markdown.html deleted file mode 100644 index 14aab61..0000000 --- a/markdown.html +++ /dev/null @@ -1,70 +0,0 @@ - - - Markdown preview demo - - - - - - - - -
-

Markdown Preview

-

This uses the Write.as / WriteFreely API to generate HTML from the given Markdown content.

-

Read the documentation.

-
- -
-
- - -
-
- -
- -
- - diff --git a/pages/markdown.tmpl b/pages/markdown.tmpl new file mode 100644 index 0000000..6578bcd --- /dev/null +++ b/pages/markdown.tmpl @@ -0,0 +1,67 @@ +{{define "head"}}Markdown Preview + + + +{{end}} + +{{define "body-attrs"}}id="post"{{end}} + +{{define "content"}} +
+

Markdown Preview

+

This uses the Write.as / WriteFreely API to generate HTML from the given Markdown content.

+

Read the documentation.

+
+ +
+
+ + +
+
+ +
+ +

(Post preview will appear here.)

+{{end}} \ No newline at end of file diff --git a/server.go b/server.go index cde066d..b8a2cbf 100644 --- a/server.go +++ b/server.go @@ -22,6 +22,7 @@ func main() { // Add routes r := mux.NewRouter() + r.HandleFunc("/{page:[a-z]+}", viewPage) r.HandleFunc("/", viewPage) r.PathPrefix("/").Handler(http.FileServer(http.Dir(staticDir)))