pug.go 812 B

1234567891011121314151617181920212223
  1. package view
  2. import (
  3. "github.com/Joker/jade"
  4. )
  5. // Pug (or Jade) returns a new pug view engine.
  6. // It shares the same exactly logic with the
  7. // html view engine, it uses the same exactly configuration.
  8. // It has got some features and a lot of functions
  9. // which will make your life easier.
  10. // Read more about the Jade Go Template: https://github.com/Joker/jade
  11. //
  12. // Examples:
  13. // https://github.com/kataras/iris/tree/master/_examples/view/template_pug_0
  14. // https://github.com/kataras/iris/tree/master/_examples/view/template_pug_1
  15. // https://github.com/kataras/iris/tree/master/_examples/view/template_pug_2
  16. // https://github.com/kataras/iris/tree/master/_examples/view/template_pug_3
  17. func Pug(directory, extension string) *HTMLEngine {
  18. s := HTML(directory, extension)
  19. s.middleware = jade.Parse
  20. return s
  21. }