Publish HTML quickly. https://html.house
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

26 lines
495 B

  1. package htmlhouse
  2. import (
  3. "fmt"
  4. "html/template"
  5. )
  6. const (
  7. templatesDir = "templates/"
  8. )
  9. func initTemplate(app *app, name string) {
  10. fmt.Printf("Loading %s%s.html\n", templatesDir, name)
  11. app.templates[name] = template.Must(template.New("").ParseFiles(templatesDir + name + ".html"))
  12. }
  13. func (app *app) initTemplates() {
  14. app.templates = map[string]*template.Template{}
  15. // Initialize dynamic pages
  16. initTemplate(app, "editor")
  17. initTemplate(app, "stats")
  18. initTemplate(app, "browse")
  19. }