diff --git a/main.go b/main.go index 78ceec1..228e328 100644 --- a/main.go +++ b/main.go @@ -19,7 +19,7 @@ type Page struct { var style = `` var name = "takunomi" var posts []Post -var templates = template.Must(template.ParseFiles("templates/blog.tmpl", "templates/about.tmpl", "templates/past.tmpl", "templates/contact.tmpl", "templates/blog_roll.tmpl", "templates/post.tmpl")) +var templates = template.Must(template.ParseFiles("templates/blog.tmpl", "templates/about.tmpl","templates/keru_shoujo.tmpl", "templates/past.tmpl", "templates/contact.tmpl", "templates/blog_roll.tmpl", "templates/post.tmpl")) func main() { @@ -45,6 +45,7 @@ func retrievePosts() { func buildHandlers() { http.HandleFunc("/about/", aboutHandler) http.HandleFunc("/past/", pastHandler) + http.HandleFunc("/the_girl_who_kicked_a_rabbit/", keruHandler) http.HandleFunc("/contact/", contactHandler) http.HandleFunc("/post/", postHandler) http.HandleFunc("/update", updateHandler) @@ -77,6 +78,11 @@ func pastHandler(w http.ResponseWriter, r *http.Request) { renderTemplates(w, page) } +func keruHandler(w http.ResponseWriter, r *http.Request) { + posts := []Post{getPostByURLTitle("The-Girl-Who-Kicked-a-Rabbit")} + page := Page{name, posts, "blog"} + renderTemplates(w, page) +} func contactHandler(w http.ResponseWriter, r *http.Request) { page := Page{name, []Post{}, "contact"} renderTemplates(w, page) diff --git a/posts/The Girl Who Kicked a Rabbit.html b/posts/The Girl Who Kicked a Rabbit.html new file mode 100644 index 0000000..f0f0543 --- /dev/null +++ b/posts/The Girl Who Kicked a Rabbit.html @@ -0,0 +1,4 @@ +


+

+ +

This game...

diff --git a/templates/about.tmpl b/templates/about.tmpl index bef773d..5e55ce5 100644 --- a/templates/about.tmpl +++ b/templates/about.tmpl @@ -1,5 +1,5 @@ {{define "about"}}
-

This is about ME!

+

"Takunomi" means drinking at home. It's when you have a cozy party in your own home, with your own music and good friends. You can play a video game in 4-player, or just chat. Is Takunomi a group, a person, or a company? I'm not sure. We're creating a game, there are some long posts about video games, and that's about it. Write us if you wanna talk, or maybe even try the game.

{{end}} diff --git a/templates/blog.tmpl b/templates/blog.tmpl index 9b2c44e..d5213b4 100644 --- a/templates/blog.tmpl +++ b/templates/blog.tmpl @@ -26,6 +26,7 @@ @@ -39,6 +40,8 @@
{{template "about" .}}
{{else if eq .CurrentPage "past"}}
{{template "past" .}}
+ {{else if eq .CurrentPage "keru_shoujo"}} +
{{template "keru_shoujo" .}}
{{else if eq .CurrentPage "contact"}}
{{template "contact" .}}
{{end}} diff --git a/templates/contact.tmpl b/templates/contact.tmpl index 11ba9c1..a00914a 100644 --- a/templates/contact.tmpl +++ b/templates/contact.tmpl @@ -3,7 +3,6 @@ {{end}} diff --git a/templates/keru_shoujo.tmpl b/templates/keru_shoujo.tmpl new file mode 100644 index 0000000..83f1881 --- /dev/null +++ b/templates/keru_shoujo.tmpl @@ -0,0 +1,3 @@ +{{define "keru_shoujo"}} +

{{.Title}}

+
{{ .Content }}
{{end}}