示例#1
0
文件: main.go 项目: uriel/plume
func main() {
	var conf_path string
	flag.StringVar(&conf_path, "conf", "config.json", "Location of configuration file. Defaults to config.json in the present working directory.")
	flag.Parse()

	conf, err := configuration.Load(conf_path)

	if err != nil {
		log.Fatal(err)
		return
	}

	theme_path := filepath.Join("themes", conf.Theme, "index.html")
	tmpl, err := theme.Load(conf.Theme, theme_path)

	if err != nil {
		log.Fatal(err)
		return
	}

	tmpl.Execute(os.Stdout, conf)
}
示例#2
0
文件: main.go 项目: neunenak/plume
func main() {
	log.SetFlags(log.LstdFlags | log.Lshortfile)

	var conf_path string
	flag.StringVar(&conf_path, "conf", "config.json", "Location of configuration file. Defaults to config.json in the present working directory.")
	flag.Parse()

	conf, err := configuration.Load(conf_path)
	if err != nil {
		log.Fatal(err)
	}

	theme_path := filepath.Join("themes", conf.Theme, "index.html")
	tpl, err := theme.Load(conf.Theme, theme_path)
	if err != nil {
		log.Fatal(err)
	}

	tpl.Execute(os.Stdout, conf)

	log.Printf("POST: %s", models.LoadPost(models.ListPosts("posts")[0]))

	// log.Printf("POSTS: %s", models.ListPosts("posts"))
}