Exemplo n.º 1
0
Arquivo: main.go Projeto: 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)
}
Exemplo n.º 2
0
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"))
}