package main
import (
"fmt"
"html/template"
"net/http"
"path/filepath"
"os"
"strings"
)
type Page struct {
Title string
Years [][]Post
//Years map[int][]Post
Posts []Post
CurrentPage string
}
var style = ``
var name = "takunomi"
var posts []Post
var years [][]Post
//var years map[int][]Post
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/title.tmpl",
"templates/navbar.tmpl",
"templates/main.tmpl",
"templates/post.tmpl"))
func main() {
buildHandlers()
retrievePosts()
if os.Args[1] == "local" {
http.ListenAndServe(":8080", nil)
}
if os.Args[1] == "ext" {
http.ListenAndServe(":35291", nil)
}
}
func retrievePosts() {
posts = nil
years = nil
//years = make(map[int][]Post)
filepath.Walk("./posts", newPost)
years = reverseYears()
for i := 0; i