This commit is contained in:
Jacob 2021-12-10 19:37:07 +01:00
parent a9b9b35d60
commit 2d841f1332
6 changed files with 18 additions and 3 deletions

View File

@ -19,7 +19,7 @@ type Page struct {
var style = `` var style = ``
var name = "takunomi" var name = "takunomi"
var posts []Post 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() { func main() {
@ -45,6 +45,7 @@ func retrievePosts() {
func buildHandlers() { func buildHandlers() {
http.HandleFunc("/about/", aboutHandler) http.HandleFunc("/about/", aboutHandler)
http.HandleFunc("/past/", pastHandler) http.HandleFunc("/past/", pastHandler)
http.HandleFunc("/the_girl_who_kicked_a_rabbit/", keruHandler)
http.HandleFunc("/contact/", contactHandler) http.HandleFunc("/contact/", contactHandler)
http.HandleFunc("/post/", postHandler) http.HandleFunc("/post/", postHandler)
http.HandleFunc("/update", updateHandler) http.HandleFunc("/update", updateHandler)
@ -77,6 +78,11 @@ func pastHandler(w http.ResponseWriter, r *http.Request) {
renderTemplates(w, page) 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) { func contactHandler(w http.ResponseWriter, r *http.Request) {
page := Page{name, []Post{}, "contact"} page := Page{name, []Post{}, "contact"}
renderTemplates(w, page) renderTemplates(w, page)

View File

@ -0,0 +1,4 @@
<p><p><figure><img src="/images/game1/fami_mockup.png"></br></img></figure>
<time datetime="2013-01-01">2013-01-01</time></p>
<p>This game...</p>

View File

@ -1,5 +1,5 @@
{{define "about"}} {{define "about"}}
<article class="post"> <article class="post">
<p>This is about ME!</p> <p>"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.</p>
</article> </article>
{{end}} {{end}}

View File

@ -26,6 +26,7 @@
<ul id="menu"> <ul id="menu">
<!-- <li><a class={{if eq .CurrentPage "blog"}} "menuselect menuElement no-link"{{else}}"menuElement no-link"{{end}} href="/">blog</a></li> --> <!-- <li><a class={{if eq .CurrentPage "blog"}} "menuselect menuElement no-link"{{else}}"menuElement no-link"{{end}} href="/">blog</a></li> -->
<li><a class={{if eq .CurrentPage "past"}} "menuselect menuElement no-link"{{else}}"menuElement no-link"{{end}} href="/past">past</a></li> <li><a class={{if eq .CurrentPage "past"}} "menuselect menuElement no-link"{{else}}"menuElement no-link"{{end}} href="/past">past</a></li>
<li><a class={{if eq .CurrentPage "keru_shoujo"}} "menuselect menuElement no-link"{{else}}"menuElement no-link"{{end}} href="/the_girl_who_kicked_a_rabbit">the girl who kicked a rabbit</a></li>
<li><a class={{if eq .CurrentPage "about"}} "menuselect menuElement no-link"{{else}}"menuElement no-link"{{end}} href="/about">about</a></li> <li><a class={{if eq .CurrentPage "about"}} "menuselect menuElement no-link"{{else}}"menuElement no-link"{{end}} href="/about">about</a></li>
<li><a class={{if eq .CurrentPage "contact"}} "menuselect menuElement no-link"{{else}}"menuElement no-link"{{end}} href="/contact">contact</a></li> <li><a class={{if eq .CurrentPage "contact"}} "menuselect menuElement no-link"{{else}}"menuElement no-link"{{end}} href="/contact">contact</a></li>
</ul> </ul>
@ -39,6 +40,8 @@
<div>{{template "about" .}}</div> <div>{{template "about" .}}</div>
{{else if eq .CurrentPage "past"}} {{else if eq .CurrentPage "past"}}
<div>{{template "past" .}}</div> <div>{{template "past" .}}</div>
{{else if eq .CurrentPage "keru_shoujo"}}
<div>{{template "keru_shoujo" .}}</div>
{{else if eq .CurrentPage "contact"}} {{else if eq .CurrentPage "contact"}}
<div>{{template "contact" .}}</div> <div>{{template "contact" .}}</div>
{{end}} {{end}}

View File

@ -3,7 +3,6 @@
<ul style="list-style: none;"> <ul style="list-style: none;">
<li><b><a class="no-link" style="text-decoration: none; color: inherit" href="https://twitter.com/sketchwhale">@sketchwhale</a></b></li> <li><b><a class="no-link" style="text-decoration: none; color: inherit" href="https://twitter.com/sketchwhale">@sketchwhale</a></b></li>
<li><b>ohayo dot jacob at gmail</b></li> <li><b>ohayo dot jacob at gmail</b></li>
<li><b><a class="no-link" style="text-decoration: none; color: inherit" href="gitfub.space/ohayo-jacob">gitfub.space/ohayo-jacob</a></b></li>
</ul> </ul>
</article> </article>
{{end}} {{end}}

View File

@ -0,0 +1,3 @@
{{define "keru_shoujo"}}
<h2 style="margin-top:0px;"><a class="no-link" style="text-decoration: none; color: inherit" href="/the_girl_who_kicked_a_rabbit/{{.URLTitle}}">{{.Title}}</a></h2>
<div>{{ .Content }}</div>{{end}}